Add internal/testkit/replay: Run and File replay a package's recorded Temporal histories against the workflows it registers, and Record writes them with stand-in activities. TEMPORAL_REPLAY_RECORD names a temporal CLI binary (the recorder starts a private in-memory dev server from it) or a running server's host:port; TEMPORAL_REPLAY_ONLY, a file-name prefix, records the files it names again. FedWiki's replay test moves onto the kit with its fourteen histories and every subtest name unchanged. Its two variables FEDWIKI_REPLAY_RECORD and FEDWIKI_REPLAY_ONLY are replaced by the two above, and its recorder skip message now reads "TEMPORAL_REPLAY_RECORD not set". The recorder now writes only the histories that do not exist yet, where FedWiki's used to rewrite every file; a recorded history stands for runs a release started, so replacing one takes TEMPORAL_REPLAY_ONLY. Claim verification gets nine recorded histories (activates, polls, check-now, expires, probe-error, mark-refused, record-fails, canceled, rollover) and the push workflow seven (applied, rose, divergent, conflict-then-applied, permanent, unlinked, gone), each replayed by TestWorkflowHistoriesReplay in internal/workflows/domains and internal/workflows/desiredstate. The kit has its own test over a two-step workflow and a recorded history of it. The 17 histories were recorded at the parent's code, from a private dev server started from the temporal CLI (1.5.1); the commands they hold match an earlier independent recording of the same scenarios, apart from the two clamped timers' durations. No file names the recording machine or its user. New tests: the kit's TestTarget, TestRecordsNeverReplaceAHistoryUnasked, TestRunReplaysARecordedHistory (and its two-steps.json subtest), TestFileRefusesAChangedWorkflow, TestEndingNamesWhatTheRunDid and TestRecordTwoSteps (skips); the import guard's subtest for internal/testkit/replay; TestWorkflowHistoriesReplay with its 9 and 7 subtests and TestRecordReplayHistories (skips) in the two workflow packages. The kit is listed in docs/testing.md and in the test-only deadcode list. No output changes: no production file is edited. At the parent and at this commit, the names and results of the section's packages are equal apart from the tests above (FedWiki's 16 results pass or skip as before), the Temporal surface listings (activities, workflows, workflow bodies, payload types) are byte-equal, go run . lint prints the same line, the lint snapshot has no added or removed key, and deadcode and golangci-lint are clean. Breaks: 9 breaks, each caught by the new tests; the 2 FedWiki breaks (a request-driven create and a create started before lifecycle requests that check the quota first) are caught by the old and the new test. Not probed: Histories and Run failing a test (no test can watch its own test fail; every production break above shows Run failing a subtest); connect, runScenario and write against a server, which run only when recording (the recording at the parent is their check). A replay cannot see activity inputs, timer durations, the result, or the ending of a history that ends canceled or failed; later tests pin those.
425 lines
12 KiB
JSON
425 lines
12 KiB
JSON
{
|
|
"events": [
|
|
{
|
|
"eventId": "1",
|
|
"eventTime": "2026-10-11T15:38:26.590784628Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_STARTED",
|
|
"taskId": "1048587",
|
|
"workflowExecutionStartedEventAttributes": {
|
|
"workflowType": {
|
|
"name": "twoSteps"
|
|
},
|
|
"taskQueue": {
|
|
"name": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af",
|
|
"kind": "TASK_QUEUE_KIND_NORMAL"
|
|
},
|
|
"input": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"workflowExecutionTimeout": "0s",
|
|
"workflowRunTimeout": "0s",
|
|
"workflowTaskTimeout": "10s",
|
|
"originalExecutionRunId": "01a12b9d-879e-7bf6-8874-45c46eecd92c",
|
|
"identity": "replay-recorder",
|
|
"firstExecutionRunId": "01a12b9d-879e-7bf6-8874-45c46eecd92c",
|
|
"attempt": 1,
|
|
"firstWorkflowTaskBackoff": "0s",
|
|
"header": {},
|
|
"workflowId": "replay-two-steps-98d66e11-3f4e-4363-ac4b-041f44272395"
|
|
}
|
|
},
|
|
{
|
|
"eventId": "2",
|
|
"eventTime": "2026-10-11T15:38:26.590856193Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
|
|
"taskId": "1048588",
|
|
"workflowTaskScheduledEventAttributes": {
|
|
"taskQueue": {
|
|
"name": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af",
|
|
"kind": "TASK_QUEUE_KIND_NORMAL"
|
|
},
|
|
"startToCloseTimeout": "10s",
|
|
"attempt": 1
|
|
}
|
|
},
|
|
{
|
|
"eventId": "3",
|
|
"eventTime": "2026-10-11T15:38:26.595011831Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
|
|
"taskId": "1048593",
|
|
"workflowTaskStartedEventAttributes": {
|
|
"scheduledEventId": "2",
|
|
"identity": "replay-recorder",
|
|
"requestId": "9e682527-8219-4398-aa27-d5baa8f65a33",
|
|
"historySizeBytes": "386",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "4",
|
|
"eventTime": "2026-10-11T15:38:26.598348477Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
|
|
"taskId": "1048597",
|
|
"workflowTaskCompletedEventAttributes": {
|
|
"scheduledEventId": "2",
|
|
"startedEventId": "3",
|
|
"identity": "replay-recorder",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
},
|
|
"sdkMetadata": {
|
|
"langUsedFlags": [
|
|
3
|
|
],
|
|
"sdkName": "temporal-go",
|
|
"sdkVersion": "1.38.0"
|
|
},
|
|
"meteringMetadata": {}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "5",
|
|
"eventTime": "2026-10-11T15:38:26.598423378Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED",
|
|
"taskId": "1048598",
|
|
"activityTaskScheduledEventAttributes": {
|
|
"activityId": "5",
|
|
"activityType": {
|
|
"name": "Step"
|
|
},
|
|
"taskQueue": {
|
|
"name": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af",
|
|
"kind": "TASK_QUEUE_KIND_NORMAL"
|
|
},
|
|
"header": {},
|
|
"input": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"scheduleToCloseTimeout": "0s",
|
|
"scheduleToStartTimeout": "0s",
|
|
"startToCloseTimeout": "10s",
|
|
"heartbeatTimeout": "0s",
|
|
"workflowTaskCompletedEventId": "4",
|
|
"retryPolicy": {
|
|
"initialInterval": "1s",
|
|
"backoffCoefficient": 2,
|
|
"maximumInterval": "100s"
|
|
},
|
|
"useWorkflowBuildId": true
|
|
}
|
|
},
|
|
{
|
|
"eventId": "6",
|
|
"eventTime": "2026-10-11T15:38:26.600011910Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_STARTED",
|
|
"taskId": "1048604",
|
|
"activityTaskStartedEventAttributes": {
|
|
"scheduledEventId": "5",
|
|
"identity": "replay-recorder",
|
|
"requestId": "c86a9c78-afe8-4be3-bf5e-bef6a2d962c6",
|
|
"attempt": 1,
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "7",
|
|
"eventTime": "2026-10-11T15:38:26.602554600Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_COMPLETED",
|
|
"taskId": "1048605",
|
|
"activityTaskCompletedEventAttributes": {
|
|
"result": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"scheduledEventId": "5",
|
|
"startedEventId": "6",
|
|
"identity": "replay-recorder"
|
|
}
|
|
},
|
|
{
|
|
"eventId": "8",
|
|
"eventTime": "2026-10-11T15:38:26.602558478Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
|
|
"taskId": "1048606",
|
|
"workflowTaskScheduledEventAttributes": {
|
|
"taskQueue": {
|
|
"name": "replay-recorder:d6ae6801-89be-4849-bba6-d71cd3ea097e",
|
|
"kind": "TASK_QUEUE_KIND_STICKY",
|
|
"normalName": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af"
|
|
},
|
|
"startToCloseTimeout": "10s",
|
|
"attempt": 1
|
|
}
|
|
},
|
|
{
|
|
"eventId": "9",
|
|
"eventTime": "2026-10-11T15:38:26.603551819Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
|
|
"taskId": "1048610",
|
|
"workflowTaskStartedEventAttributes": {
|
|
"scheduledEventId": "8",
|
|
"identity": "replay-recorder",
|
|
"requestId": "a1ddab1a-3883-470b-b890-7b42bbf2035e",
|
|
"historySizeBytes": "1121",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "10",
|
|
"eventTime": "2026-10-11T15:38:26.605226223Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
|
|
"taskId": "1048614",
|
|
"workflowTaskCompletedEventAttributes": {
|
|
"scheduledEventId": "8",
|
|
"startedEventId": "9",
|
|
"identity": "replay-recorder",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
},
|
|
"sdkMetadata": {},
|
|
"meteringMetadata": {}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "11",
|
|
"eventTime": "2026-10-11T15:38:26.605266269Z",
|
|
"eventType": "EVENT_TYPE_TIMER_STARTED",
|
|
"taskId": "1048615",
|
|
"userMetadata": {
|
|
"summary": {
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "IlNsZWVwIg=="
|
|
}
|
|
},
|
|
"timerStartedEventAttributes": {
|
|
"timerId": "11",
|
|
"startToFireTimeout": "1s",
|
|
"workflowTaskCompletedEventId": "10"
|
|
}
|
|
},
|
|
{
|
|
"eventId": "12",
|
|
"eventTime": "2026-10-11T15:38:27.607274275Z",
|
|
"eventType": "EVENT_TYPE_TIMER_FIRED",
|
|
"taskId": "1048618",
|
|
"timerFiredEventAttributes": {
|
|
"timerId": "11",
|
|
"startedEventId": "11"
|
|
}
|
|
},
|
|
{
|
|
"eventId": "13",
|
|
"eventTime": "2026-10-11T15:38:27.607285546Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
|
|
"taskId": "1048619",
|
|
"workflowTaskScheduledEventAttributes": {
|
|
"taskQueue": {
|
|
"name": "replay-recorder:d6ae6801-89be-4849-bba6-d71cd3ea097e",
|
|
"kind": "TASK_QUEUE_KIND_STICKY",
|
|
"normalName": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af"
|
|
},
|
|
"startToCloseTimeout": "10s",
|
|
"attempt": 1
|
|
}
|
|
},
|
|
{
|
|
"eventId": "14",
|
|
"eventTime": "2026-10-11T15:38:27.609119791Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
|
|
"taskId": "1048623",
|
|
"workflowTaskStartedEventAttributes": {
|
|
"scheduledEventId": "13",
|
|
"identity": "replay-recorder",
|
|
"requestId": "d295e7f9-3bc2-41f0-b735-5386dd5aa623",
|
|
"historySizeBytes": "1570",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "15",
|
|
"eventTime": "2026-10-11T15:38:27.611665778Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
|
|
"taskId": "1048627",
|
|
"workflowTaskCompletedEventAttributes": {
|
|
"scheduledEventId": "13",
|
|
"startedEventId": "14",
|
|
"identity": "replay-recorder",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
},
|
|
"sdkMetadata": {},
|
|
"meteringMetadata": {}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "16",
|
|
"eventTime": "2026-10-11T15:38:27.611696005Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED",
|
|
"taskId": "1048628",
|
|
"activityTaskScheduledEventAttributes": {
|
|
"activityId": "16",
|
|
"activityType": {
|
|
"name": "Other"
|
|
},
|
|
"taskQueue": {
|
|
"name": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af",
|
|
"kind": "TASK_QUEUE_KIND_NORMAL"
|
|
},
|
|
"header": {},
|
|
"input": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"scheduleToCloseTimeout": "0s",
|
|
"scheduleToStartTimeout": "0s",
|
|
"startToCloseTimeout": "10s",
|
|
"heartbeatTimeout": "0s",
|
|
"workflowTaskCompletedEventId": "15",
|
|
"retryPolicy": {
|
|
"initialInterval": "1s",
|
|
"backoffCoefficient": 2,
|
|
"maximumInterval": "100s"
|
|
},
|
|
"useWorkflowBuildId": true
|
|
}
|
|
},
|
|
{
|
|
"eventId": "17",
|
|
"eventTime": "2026-10-11T15:38:27.612875396Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_STARTED",
|
|
"taskId": "1048633",
|
|
"activityTaskStartedEventAttributes": {
|
|
"scheduledEventId": "16",
|
|
"identity": "replay-recorder",
|
|
"requestId": "dae204ee-4725-40bc-9213-1bff3319cd0e",
|
|
"attempt": 1,
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "18",
|
|
"eventTime": "2026-10-11T15:38:27.614210972Z",
|
|
"eventType": "EVENT_TYPE_ACTIVITY_TASK_COMPLETED",
|
|
"taskId": "1048634",
|
|
"activityTaskCompletedEventAttributes": {
|
|
"result": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"scheduledEventId": "16",
|
|
"startedEventId": "17",
|
|
"identity": "replay-recorder"
|
|
}
|
|
},
|
|
{
|
|
"eventId": "19",
|
|
"eventTime": "2026-10-11T15:38:27.614216563Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
|
|
"taskId": "1048635",
|
|
"workflowTaskScheduledEventAttributes": {
|
|
"taskQueue": {
|
|
"name": "replay-recorder:d6ae6801-89be-4849-bba6-d71cd3ea097e",
|
|
"kind": "TASK_QUEUE_KIND_STICKY",
|
|
"normalName": "replay-record-d420bd45-8b6b-45e1-b538-d918a17834af"
|
|
},
|
|
"startToCloseTimeout": "10s",
|
|
"attempt": 1
|
|
}
|
|
},
|
|
{
|
|
"eventId": "20",
|
|
"eventTime": "2026-10-11T15:38:27.615192622Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
|
|
"taskId": "1048639",
|
|
"workflowTaskStartedEventAttributes": {
|
|
"scheduledEventId": "19",
|
|
"identity": "replay-recorder",
|
|
"requestId": "5ba35616-580b-45a3-8f28-ce53da36e340",
|
|
"historySizeBytes": "2283",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "21",
|
|
"eventTime": "2026-10-11T15:38:27.616765284Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
|
|
"taskId": "1048643",
|
|
"workflowTaskCompletedEventAttributes": {
|
|
"scheduledEventId": "19",
|
|
"startedEventId": "20",
|
|
"identity": "replay-recorder",
|
|
"workerVersion": {
|
|
"buildId": "13235327a3d7497e6a90e00aca07a850"
|
|
},
|
|
"sdkMetadata": {},
|
|
"meteringMetadata": {}
|
|
}
|
|
},
|
|
{
|
|
"eventId": "22",
|
|
"eventTime": "2026-10-11T15:38:27.616808676Z",
|
|
"eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
|
|
"taskId": "1048644",
|
|
"workflowExecutionCompletedEventAttributes": {
|
|
"result": {
|
|
"payloads": [
|
|
{
|
|
"metadata": {
|
|
"encoding": "anNvbi9wbGFpbg=="
|
|
},
|
|
"data": "ImtpdCI="
|
|
}
|
|
]
|
|
},
|
|
"workflowTaskCompletedEventId": "21"
|
|
}
|
|
}
|
|
]
|
|
}
|