You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addresses #179
**Workflow forking**
- Added `forked_from` column to `workflow_status` to track original
workflow ID during fork operations.
- Added ForkedFrom filter option for ListWorkflows.
**Step timestamps:** Added `started_at_epoch_ms` and
`completed_at_epoch_ms` columns to `operation_outputs` to track step
execution times. All special steps (`send`, `recv`, `sleep`, `setEvent`,
`getEvent`) also capture and record timestamps.
**Conductor protocol:** Updated workflow and step responses to include
new fields (`ForkedFrom`, `WorkflowTimeoutMS`,
`WorkflowDeadlineEpochMS`, `started_at_epoch_ms`,
`completed_at_epoch_ms`) as strings.
**Admin server:** Updated workflow list response to use
`WorkflowDeadlineEpochMS` instead of `Deadline`
**Database changes:** Added migrations 4 and 5.
**Tests:** Updated tests to verify new fields are present and timestamps
are set correctly for all special steps.
assert.Nil(t, step.Error, "expected no error in step")
1071
1087
assert.Equal(t, "", step.ChildWorkflowID, "expected no child workflow ID")
1072
1088
1089
+
// Verify timestamps are present
1090
+
assert.False(t, step.StartedAt.IsZero(), "expected step to have StartedAt timestamp")
1091
+
assert.False(t, step.CompletedAt.IsZero(), "expected step to have CompletedAt timestamp")
1092
+
assert.True(t, step.CompletedAt.After(step.StartedAt) ||step.CompletedAt.Equal(step.StartedAt), "expected CompletedAt to be after or equal to StartedAt")
1093
+
1073
1094
// Verify the output wasn't loaded
1074
1095
require.Nil(t, step.Output, "expected output not to be loaded")
assert.True(t, exists, "dbos_migrations table should exist")
253
253
254
-
// Verify migration version is 3 (after initial migration, queue partition key migration, and workflow status index migration)
254
+
// Verify migration version is 5 (after initial migration, queue partition key migration, workflow status index migration, forked_from migration, and step timestamps migration)
255
255
varversionint64
256
256
varcountint
257
257
err=sysDB.pool.QueryRow(dbCtx, "SELECT COUNT(*) FROM dbos.dbos_migrations").Scan(&count)
err=sysDB.pool.QueryRow(dbCtx, "SELECT version FROM dbos.dbos_migrations").Scan(&version)
262
262
require.NoError(t, err)
263
-
assert.Equal(t, int64(3), version, "migration version should be 3 (after initial migration, queue partition key migration, and workflow status index migration)")
263
+
assert.Equal(t, int64(5), version, "migration version should be 5 (after initial migration, queue partition key migration, workflow status index migration, forked_from migration, and step timestamps migration)")
assert.True(t, exists, "dbos_migrations table should exist in custom schema")
461
461
462
-
// Verify migration version is 3 (after initial migration, queue partition key migration, and workflow status index migration)
462
+
// Verify migration version is 5 (after initial migration, queue partition key migration, workflow status index migration, forked_from migration, and step timestamps migration)
463
463
varversionint64
464
464
varcountint
465
465
err=sysDB.pool.QueryRow(dbCtx, fmt.Sprintf("SELECT COUNT(*) FROM %s.dbos_migrations", customSchema)).Scan(&count)
err=sysDB.pool.QueryRow(dbCtx, fmt.Sprintf("SELECT version FROM %s.dbos_migrations", customSchema)).Scan(&version)
470
470
require.NoError(t, err)
471
-
assert.Equal(t, int64(3), version, "migration version should be 3 (after initial migration, queue partition key migration, and workflow status index migration)")
471
+
assert.Equal(t, int64(5), version, "migration version should be 5 (after initial migration, queue partition key migration, workflow status index migration, forked_from migration, and step timestamps migration)")
472
472
})
473
473
474
474
// Test workflows for exercising Send/Recv and SetEvent/GetEvent
0 commit comments