visibility_persistence_suite.go ×4

Frontier kind: Code frontier

unlabeled · c_2d02eb47be16

5 tests · 4523 LOC · 189 files · introduces 0 tests · 122 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges122 lines · 5 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
838 ranges4523 lines · 189 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

5 files ranked by introduced lines: 122 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/tests/visibility_persistence_suite.go 101 introduced LOC · 4 ranges

Open complete file

698
699 // TestDelete test
700 > func (s *VisibilityPersistenceSuite) TestDeleteWorkflow() { visibility_persistence_suite.go
701 > openRows := 10
702 > closedRows := 5
703 > testNamespaceUUID := namespace.ID(uuid.NewString())
704 > closeTime := time.Now().UTC()
705 > startTime := closeTime.Add(-5 * time.Second)
706 > executionTime := closeTime.Add(-4 * time.Second)
707 > var startRequests []*manager.RecordWorkflowExecutionStartedRequest
708 > for range openRows {
709 > startReq := s.createOpenWorkflowRecord(
710 > testNamespaceUUID,
711 > uuid.NewString(),
712 > "visibility-workflow",
713 > startTime,
714 > executionTime,
715 > "test-queue",
716 > )
717 > startRequests = append(startRequests, startReq)
718 > }
719
720 > for i := range closedRows { visibility_persistence_suite.go
721 > s.createClosedWorkflowRecord(
722 > startRequests[i],
723 > closeTime,
724 > enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED,
725 > )
726 > }
727
728 // ListClosedWorkflowExecutions
729 > resp, err3 := s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{ visibility_persistence_suite.go
730 > NamespaceID: testNamespaceUUID,
731 > PageSize: 10,
732 > Query: fmt.Sprintf("%s >= '%s' AND %s <= '%s' AND %s != '%s'",
733 > sadefs.CloseTime,
734 > startTime.Format(time.RFC3339Nano),
735 > sadefs.CloseTime,
736 > closeTime.Format(time.RFC3339Nano),
737 > sadefs.ExecutionStatus,
738 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
739 > ),
740 > })
741 > s.NoError(err3)
742 > s.Len(resp.Executions, closedRows)
743 >
744 > // Delete closed workflow
745 > for _, row := range resp.Executions {
746 > err4 := s.VisibilityMgr.DeleteWorkflowExecution(s.ctx, &manager.VisibilityDeleteWorkflowExecutionRequest{
747 > NamespaceID: testNamespaceUUID,
748 > WorkflowID: row.GetExecution().GetWorkflowId(),
749 > RunID: row.GetExecution().GetRunId(),
750 > })
751 > s.NoError(err4)
752 > }
753
754 // ListClosedWorkflowExecutions
755 > resp, err5 := s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{ visibility_persistence_suite.go
756 > NamespaceID: testNamespaceUUID,
757 > PageSize: 10,
758 > Query: fmt.Sprintf("%s >= '%s' AND %s <= '%s' AND %s != '%s'",
759 > sadefs.CloseTime,
760 > startTime.Format(time.RFC3339Nano),
761 > sadefs.CloseTime,
762 > closeTime.Format(time.RFC3339Nano),
763 > sadefs.ExecutionStatus,
764 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
765 > ),
766 > })
767 > s.NoError(err5)
768 > s.Empty(resp.Executions)
769 >
770 > // ListOpenWorkflowExecutions
771 > resp, err6 := s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
772 > NamespaceID: testNamespaceUUID,
773 > Query: fmt.Sprintf("%s >= '%s' AND %s <= '%s'AND %s = '%s'",
774 > sadefs.StartTime,
775 > startTime.Format(time.RFC3339Nano),
776 > sadefs.StartTime,
777 > closeTime.Format(time.RFC3339Nano),
778 > sadefs.ExecutionStatus,
779 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
780 > ),
781 > PageSize: 10,
782 > })
783 > s.NoError(err6)
784 > s.Len(resp.Executions, openRows-closedRows)
785 > // Delete open workflow
786 > for _, row := range resp.Executions {
787 > err7 := s.VisibilityMgr.DeleteWorkflowExecution(s.ctx, &manager.VisibilityDeleteWorkflowExecutionRequest{
788 > NamespaceID: testNamespaceUUID,
789 > WorkflowID: row.GetExecution().GetWorkflowId(),
790 > RunID: row.GetExecution().GetRunId(),
791 > })
792 > s.NoError(err7)
793 > }
794 > resp, err8 := s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
795 > NamespaceID: testNamespaceUUID,
796 > Query: fmt.Sprintf("%s >= '%s' AND %s <= '%s'",
797 > sadefs.StartTime,
798 > startTime.Format(time.RFC3339Nano),
799 > sadefs.StartTime,
800 > closeTime.Format(time.RFC3339Nano),
801 > ),
802 > PageSize: 10,
803 > })
804 > s.NoError(err8)
805 > s.Empty(resp.Executions)
806 }
807
go.temporal.io/server/common/persistence/visibility/visiblity_manager_metrics.go 8 introduced LOC · 1 range

Open complete file

112 ctx context.Context,
113 request *manager.VisibilityDeleteWorkflowExecutionRequest,
115 > handler, startTime := m.tagScope(metrics.VisibilityPersistenceDeleteWorkflowExecutionScope)
116 > err := m.delegate.DeleteWorkflowExecution(ctx, request)
117 > elapsed := time.Since(startTime)
118 > metrics.VisibilityPersistenceLatency.With(handler).Record(elapsed)
119 > metrics.ContextCounterAdd(ctx, metrics.TaskPersistenceLatency.Name(), elapsed.Nanoseconds())
120 > return m.updateErrorMetric(handler, err)
121 > }
122
123 func (m *visibilityManagerMetrics) ListWorkflowExecutions(
go.temporal.io/server/common/persistence/visibility/store/sql/visibility_store.go 7 introduced LOC · 2 ranges

Open complete file

183 ctx context.Context,
184 request *manager.VisibilityDeleteWorkflowExecutionRequest,
185 > ) error { visibility_store.go
186 > _, err := s.sqlStore.DB.DeleteFromVisibility(ctx, sqlplugin.VisibilityDeleteFilter{
187 > NamespaceID: request.NamespaceID.String(),
188 > RunID: request.RunID,
189 > })
190 > if err != nil {
191 return convertSQLError("DeleteWorkflowExecution operation failed.", err)
192 }
193 > return nil visibility_store.go
194 }
195
go.temporal.io/server/common/persistence/visibility/visibility_manager_impl.go 3 introduced LOC · 1 range

Open complete file

139 ctx context.Context,
140 request *manager.VisibilityDeleteWorkflowExecutionRequest,
141 > ) error { visibility_manager_impl.go
142 > return p.store.DeleteWorkflowExecution(ctx, request)
143 > }
144
145 func (p *visibilityManagerImpl) ListWorkflowExecutions(
go.temporal.io/server/common/persistence/visibility/visibility_manager_rate_limited.go 3 introduced LOC · 2 ranges

Open complete file

100 ctx context.Context,
101 request *manager.VisibilityDeleteWorkflowExecutionRequest,
103 > if ok := allow(ctx, "DeleteWorkflowExecution", m.writeRateLimiter); !ok {
104 return persistence.ErrPersistenceSystemLimitExceeded
105 }
106 > return m.delegate.DeleteWorkflowExecution(ctx, request) visibility_manager_rate_limited.go
107 }
108