execution_mutable_state.go ×1

Frontier kind: Code frontier

unlabeled · c_780f38685165

7 tests · 4897 LOC · 167 files · introduces 0 tests · 104 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
1 range104 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
894 ranges4897 lines · 167 files · Browse complete extent
All tests (intent)
7 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.

1 file ranked by introduced lines: 104 introduced LOC across 1 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/tests/execution_mutable_state.go 104 introduced LOC · 1 range

Open complete file

1514 }
1515
1516 > func (s *ExecutionMutableStateSuite) TestConflictResolve_SuppressCurrent_WithNew_CHASM() { execution_mutable_state.go
1517 > archetypeID := rand.Uint32()
1518 > currentSnapshot := s.CreateCHASMExecution(
1519 > rand.Int63(),
1520 > enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
1521 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
1522 > rand.Int63(),
1523 > archetypeID,
1524 > )
1525 >
1526 > baseRunID := uuid.New().String()
1527 > baseSnapshot, baseEvents := RandomSnapshot(
1528 > s.T(),
1529 > s.NamespaceID,
1530 > s.WorkflowID,
1531 > baseRunID,
1532 > common.FirstEventID,
1533 > rand.Int63(),
1534 > enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
1535 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
1536 > rand.Int63(),
1537 > nil,
1538 > )
1539 > s.Empty(baseEvents)
1540 > _, err := s.ExecutionManager.CreateWorkflowExecution(s.Ctx, &p.CreateWorkflowExecutionRequest{
1541 > ShardID: s.ShardID,
1542 > RangeID: s.RangeID,
1543 > Mode: p.CreateWorkflowModeBypassCurrent,
1544 >
1545 > PreviousRunID: "",
1546 > PreviousLastWriteVersion: 0,
1547 >
1548 > ArchetypeID: archetypeID,
1549 >
1550 > NewWorkflowSnapshot: *baseSnapshot,
1551 > NewWorkflowEvents: baseEvents,
1552 > })
1553 > s.NoError(err)
1554 >
1555 > resetSnapshot, resetEvents := RandomSnapshot(
1556 > s.T(),
1557 > s.NamespaceID,
1558 > s.WorkflowID,
1559 > baseRunID,
1560 > baseSnapshot.NextEventID,
1561 > rand.Int63(),
1562 > enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED,
1563 > enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED,
1564 > baseSnapshot.DBRecordVersion+1,
1565 > nil,
1566 > )
1567 > s.Empty(resetEvents)
1568 >
1569 > newRunID := uuid.New().String()
1570 > newSnapshot, newEvents := RandomSnapshot(
1571 > s.T(),
1572 > s.NamespaceID,
1573 > s.WorkflowID,
1574 > newRunID,
1575 > common.FirstEventID,
1576 > rand.Int63(),
1577 > enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
1578 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
1579 > rand.Int63(),
1580 > nil,
1581 > )
1582 > s.Empty(newEvents)
1583 >
1584 > currentMutation, currentEvents := RandomMutation(
1585 > s.T(),
1586 > s.NamespaceID,
1587 > s.WorkflowID,
1588 > s.RunID,
1589 > newSnapshot.NextEventID,
1590 > rand.Int63(),
1591 > enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
1592 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
1593 > currentSnapshot.DBRecordVersion+1,
1594 > nil,
1595 > )
1596 > s.Empty(currentEvents)
1597 >
1598 > _, err = s.ExecutionManager.ConflictResolveWorkflowExecution(s.Ctx, &p.ConflictResolveWorkflowExecutionRequest{
1599 > ShardID: s.ShardID,
1600 > RangeID: s.RangeID,
1601 > Mode: p.ConflictResolveWorkflowModeUpdateCurrent,
1602 >
1603 > ArchetypeID: archetypeID,
1604 >
1605 > ResetWorkflowSnapshot: *resetSnapshot,
1606 > ResetWorkflowEvents: resetEvents,
1607 >
1608 > NewWorkflowSnapshot: newSnapshot,
1609 > NewWorkflowEvents: newEvents,
1610 >
1611 > CurrentWorkflowMutation: currentMutation,
1612 > CurrentWorkflowEvents: currentEvents,
1613 > })
1614 > s.NoError(err)
1615 >
1616 > s.AssertMSEqualWithDB(archetypeID, resetSnapshot)
1617 > s.AssertMSEqualWithDB(archetypeID, newSnapshot)
1618 > s.AssertMSEqualWithDB(archetypeID, currentSnapshot, currentMutation)
1619 > }
1620
1621 func (s *ExecutionMutableStateSuite) TestConflictResolve_ResetCurrent() {