Repository navigation
Fix replay and bookkeeping bugs: directed signals, refused markers and schedules, canceled events, CLI - #487
Merged
Merged
Conversation
find_signal_event looked a SignalTask up in history.signals first, by
name only. history.signals holds the signals this workflow received, so
it says nothing about a signal this workflow sends to another one.
Failure scenario: a workflow receives "a_signal" and then submits
signal("a_signal", workflow_id="other"). The received signal was taken
for the task's event, the future was finished with the received input,
and no SignalExternalWorkflowExecution decision was ever made. The other
workflow never got the signal.
The received signals are now consulted only for a signal the workflow
sends to itself: no workflow_id, or its own workflow_id with no run_id
or its own run_id. Anything else is matched against the deliveries and
the in-flight or refused sends, as before. A signal to another run of
the same workflow_id is a directed signal.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
find_marker_event kept only "recorded" markers, so a marker SWF refused (RecordMarkerFailed, parsed as "record_failed") was never found. _get_future_from_marker_event did have a branch for it, but it tested state == "failed", a state the parser never writes. Failure scenario: the decider's IAM policy denies RecordMarker, the only documented cause (OPERATION_NOT_PERMITTED). Each replay found no event for the MarkerTask and issued RecordMarker again; each refusal schedules a new decision task, so the workflow looped on the same refused decision. find_marker_event now returns, in order: the latest recorded marker with the task's details, else the latest refusal for that marker name. The future branch tests "record_failed" and yields TaskFailed(name, cause). RecordMarkerFailed has no details, so a refusal cannot be tied to one MarkerTask: it stands for every not-yet-recorded marker of that name. The history builder gains add_marker_record_failed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Event states are the SWF event type name minus its prefix, snake_cased:
ActivityTaskCanceled and WorkflowExecutionCanceled both give "canceled".
Two parser branches in history.py tested "cancelled", so they never ran
and both events were dropped.
Failure scenario, activity: an activity is canceled (cancel requested,
then ActivityTaskCanceled). The entry stayed "cancel_requested", or
"started"/"scheduled" without a request, so the executor's own
state == "canceled" branch was unreachable: the future stayed pending,
the activity kept counting as open, and a workflow waiting on it blocked
until its own timeout.
Failure scenario, workflow: History.workflow kept state "started" for a
canceled execution (visible in the CLI's history dump).
Both branches now test "canceled". The activity branch wrote a
"cancelled_timestamp" key that no reader could find: stats and the CLI
read f"{state}_timestamp". It now writes "canceled_timestamp" and
"canceled_id", like the other terminal states, and ActivityTaskEventDict
follows. The workflow branch already derived its keys from the state.
The history builder gains add_activity_task_cancel_requested,
add_activity_task_canceled and add_workflow_execution_canceled.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two kinds of activity entries lack the keys of a scheduled one:
- a refused schedule (ScheduleActivityTaskFailed) with no earlier
ActivityTaskScheduled has state, cause and activity_type, but no id,
name, version, input nor scheduled_id;
- a cancel request for an activity id the history does not know has an
id, but no name, version, input nor scheduled_id.
Failure scenario: on a workflow whose history holds such an entry,
`simpleflow workflow.tasks` raised KeyError('name') (pretty.status),
`workflow.info` raised KeyError('input') when the entry was the first
task (pretty.info), `task.info` raised KeyError('id') (pretty.get_task)
and `activity.rerun` raised KeyError('scheduled_id') before reaching the
activity asked for (helpers.find_activity).
The readers now tolerate the missing keys, rather than the parser
inventing them: these entries feed the decider too, and it was not
worth changing what it sees for a display problem.
- status shows the name, else the refused activity type's name, else
the activity id;
- get_task falls back on the task id and the refused activity type, and
on None for the input;
- info reports no input instead of raising;
- find_activity skips entries that were never scheduled: there is
nothing to run again, so asking for one gives the usual
"Couldn't find activity."
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…k has no state timestamp
pretty.info computed the execution time from the first and last entries
of history.tasks, reading f"{state}_timestamp" from them. Two kinds of
task have no such key:
- a received signal ("signaled") carries a plain `timestamp`;
- a child workflow not started yet ("start_initiated") carries
`initiated_event_timestamp`.
So a history whose first task is a signal raised
KeyError('signaled_timestamp'), and one whose first or last task is a
child workflow still waiting to start raised
KeyError('start_initiated_timestamp'). The last task already fell back
to `timestamp`; the first did not.
get_task_timestamp reads the state timestamp, then `timestamp`, then
`initiated_event_timestamp`, and info uses it for both ends. The
execution time keeps its meaning: last task minus first task.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pretty.info filled its `input` column from the first task of the
history: the first activity's or child workflow's input, or the first
received signal's. Only a history with no task fell back to the
workflow's input, from the first event.
The input now always comes from the first event,
WorkflowExecutionStarted. The parser already relies on it being first
(event ids start at 1). An absent SWF input decodes to {}.
The existing test_info pinned the first task's input (None); it now
expects the workflow's ({}).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ScheduleActivityTaskFailed entry made the executor schedule the activity again in the next decision, whatever the cause. SWF answers a failed decision with a new decision task, so a refusal that does not go away (deprecated type, missing default timeout or task list, OPERATION_NOT_PERMITTED) looped until the execution hit its event cap, and a rate or limit refusal was retried at full speed. Transient causes (ACTIVITY_CREATION_RATE_EXCEEDED, OPEN_ACTIVITIES_LIMIT_EXCEEDED, ACTIVITY_ID_ALREADY_IN_USE, ACTIVITY_TYPE_DOES_NOT_EXIST) now start a timer, and the activity is scheduled again once it fires. The delay is 2^n seconds for the n-th refusal in a row, capped at 300 s; a successful schedule resets n. The first ACTIVITY_TYPE_DOES_NOT_EXIST still creates the type and schedules again at once, as before; later ones create it and wait. The timer id, __simpleflow_schedule_<refusal event id>_<activity id>, is distinct per refusal and from the failure-retry timer (__simpleflow_task_<id>), so a fired timer from an earlier refusal never stands for a later one. Any other cause is a failed attempt: the task's future fails with TaskFailed(<activity id>, <cause>) and goes through handle_failure, so raises_on_failure, `retry` and on_task_failure apply. Refusals do not increment the history's `retry`, so the failure context's event gets `retry` = earlier failures + refusals in a row - 1, the value a failed execution would have had. Each retry that is refused again raises it, so the default handling stops after `retry` attempts and attempt-based stop strategies in on_task_failure stop too. Before, a deprecated type or a missing default was rescheduled until the event cap; a mandatory activity now fails its workflow. History: a schedule_failed entry now carries id (the activity id), schedule_failed_id, schedule_failed_count and the refusal's decision_task_completed_event_id. schedule_failed_id lets handled_failures key a never-scheduled entry (get_event_id returned None for all of them, so two refused activities in one replay shared one outcome). The decision id is what do_handle_failure's timer lookup reads; it raised KeyError on a never-scheduled entry. on_task_failure implementations read event["id"]. If the backoff timer itself is refused (e.g. OPEN_TIMERS_LIMIT_EXCEEDED), the activity is scheduled again at once. Not changed: a child workflow's refused start still goes through the default retry handling without incrementing `retry`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A StartChildWorkflowExecutionFailed other than WORKFLOW_TYPE_DOES_NOT_EXIST became a TaskFailed future through handle_failure, and the default handling compared the history's `retry` with the child's: refusals never incremented `retry`, so a child with retry > 0 was started again on every decision until the execution hit its event cap. A rate or limit refusal failed the attempt instead of waiting, and a missing type was created and started again at once, for ever if the refusal persisted. Two children refused before being initiated (initiatedEventId is 0 for every cause but WORKFLOW_ALREADY_RUNNING) also shared one handled_failures entry: get_event_id returned None for both. resume_refused_activity becomes resume_refused_task, used by both resume_activity and resume_child_workflow: - transient causes (CHILD_CREATION_RATE_EXCEEDED, OPEN_CHILDREN_LIMIT_EXCEEDED, OPEN_WORKFLOWS_LIMIT_EXCEEDED, WORKFLOW_TYPE_DOES_NOT_EXIST for children) start a timer __simpleflow_<refusal state>_<refusal event id>_<task id>, delay 2^n s capped at 300 s; the first missing type is created and tried again at once; - any other cause is a failed attempt, with `retry` = earlier failures + refusals in a row - 1. WORKFLOW_ALREADY_RUNNING stays a failed attempt: the running execution may be another one, for an unbounded time. History: a child start_failed entry gains start_failed_count, reset when the child starts, and get_event_id knows start_failed_id. The type creation moves to create_workflow_type; create_activity_type skips a type already created in this replay. The activity backoff timer is now named __simpleflow_schedule_failed_<id>_<task id>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…used When SWF refused the StartTimer of a refused activity or child workflow, resume_refused_task scheduled the task again at once. Under OPEN_ACTIVITIES_LIMIT_EXCEEDED plus OPEN_TIMERS_LIMIT_EXCEEDED that is a loop: task refused, timer refused, task refused..., two decisions per turn, until a limit clears or the execution hits its event cap. Now, by the timer's cause: - OPEN_TIMERS_LIMIT_EXCEEDED: the limit is per execution (1,000 open timers), so this execution's own timers will fire. The decision that the refusal brings waits (pending future, no decision); a later decision, i.e. one after a DecisionTaskCompleted that follows the refusal, starts the same timer again. A decision task timeout adds no DecisionTaskCompleted, so it waits again. - TIMER_CREATION_RATE_EXCEEDED: start the same timer again at once. This is an account-wide token bucket (StartTimer: 2,000, refilled at 200/s); nothing else is sure to wake the execution, so this stays a loop paced by decision round trips while SWF throttles. Same choice as the failure-retry timer (#484). - anything else (OPERATION_NOT_PERMITTED, TIMER_ID_ALREADY_IN_USE): a failed attempt, through the same path and attempt count as a permanent refusal. TaskFailed keeps the task's refusal cause as reason; details name the timer and its cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…imers limit do_handle_failure treats a refused failure-retry timer (__simpleflow_task_<id>) with a cause in TRANSIENT_START_TIMER_FAILED_CAUSES as never started, and asks on_task_failure again, which starts the same timer again in the same decision. For OPEN_TIMERS_LIMIT_EXCEEDED that is a loop, timer refused, timer started again, refused..., until a timer of the execution happens to fire between two turns. The limit is per execution (1,000 open timers), so this execution's own timers will fire and bring a decision. Now the decision that the refusal brings returns a pending future and no decision; a later one, i.e. after a DecisionTaskCompleted that follows the refusal, starts the timer again as before. A decision task timeout adds no DecisionTaskCompleted, so it waits again. TIMER_CREATION_RATE_EXCEEDED still starts it again at once, as #484 chose. Same rule as for the backoff timer of a refused task, through the same decided_since helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests.data.constants builds DOMAIN = Domain("TestDomain") at import,
which creates the SWF boto3 client and caches it for the process
(boto3_utils.get_or_create_boto3_client). moto 4 hooks into botocore
when it is imported and only stubs clients created after that. When the
first test module imports tests.data.constants before anything imports
moto, every later @mock_swf test reuses an unstubbed client and calls
the real SWF endpoint, failing with UnrecognizedClientException (with
the fake keys from pytest's env) or worse with real credentials.
Two orders hit it: test_executor.py run alone (3 MockSWFTestCase tests),
and test_executor.py with test_dataflow.py under
-k "Refused or schedule_failed" (test_activity_not_found_schedule_failed).
The full run passed only because an earlier module imported moto first.
tests/conftest.py imports moto, and pytest loads it before any test
module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_overriding_a_setting left METROLOGY_PATH_PREFIX = "123" (and test_change_multiple_settings left FOO and BAR) in simpleflow.settings for the rest of the process. test_metrology, run after it, uploaded under 123/local/local/ and read local/local/activity.0.json back: HeadObject 404. The default order runs test_metrology.py before test_simpleflow/, which is why it passed. setUp patches the module's namespace with mock.patch.dict and swaps _keys for a copy, since put_setting adds to it in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both branches add tests to tests/test_simpleflow/swf/test_executor.py; keep both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Five fixes from the "Not addressed" list of #485, plus five found while making them, one commit each. Seven are on the replay path, three are CLI only. Two more commits fix order-dependent tests.
simpleflow/swf/executor.py,find_signal_event:history.signals) are consulted only for a signal the workflow sends to itself: noworkflow_id, or its ownworkflow_idwith norun_idor its ownrun_id;signaled_workflows) and the in-flight or refused sends, as Replay a raced timer cancel and an in-flight or refused signal correctly #485 set up.simpleflow/swf/executor.py:find_marker_eventreturns the latest recorded marker with the task's details, else the latestrecord_failedentry for that marker name;_get_future_from_marker_eventtestedstate == "failed", which the parser never writes. It now testsrecord_failedand gives aTaskFailed(marker_name, cause)future.simpleflow/swf/executor.py,resume_refused_task:ACTIVITY_CREATION_RATE_EXCEEDED,OPEN_ACTIVITIES_LIMIT_EXCEEDED,ACTIVITY_ID_ALREADY_IN_USE,ACTIVITY_TYPE_DOES_NOT_EXIST) start a timer__simpleflow_schedule_failed_<refusal event id>_<activity id>, and the activity is scheduled again once it fires. The delay is 2^n s for the n-th refusal in a row, capped at 300 s. A successful schedule resets n. The firstACTIVITY_TYPE_DOES_NOT_EXISTstill creates the type and schedules again at once;ACTIVITY_TYPE_DEPRECATED,DEFAULT_*_UNDEFINED,OPERATION_NOT_PERMITTED) is a failed attempt: aTaskFailed(<activity id>, <cause>)future throughhandle_failure, soraises_on_failure,retryandon_task_failureapply;simpleflow/history.py: aschedule_failedentry carriesid,schedule_failed_id,schedule_failed_countand the refusal'sdecision_task_completed_event_id.get_event_idknowsschedule_failed_id.resume_child_workflowalso goes throughresume_refused_task:CHILD_CREATION_RATE_EXCEEDED,OPEN_CHILDREN_LIMIT_EXCEEDED,OPEN_WORKFLOWS_LIMIT_EXCEEDED,WORKFLOW_TYPE_DOES_NOT_EXIST) start a timer__simpleflow_start_failed_<refusal event id>_<workflow id>, with the same delays; the first missing type is created and started again at once;WORKFLOW_ALREADY_RUNNINGincluded, is a failed attempt, counted the same way;simpleflow/history.py: astart_failedentry carriesstart_failed_count, reset when the child starts.get_event_idknowsstart_failed_id. Type creation moves tocreate_workflow_type.resume_refused_task, by the timer's cause:OPEN_TIMERS_LIMIT_EXCEEDED: the decision the refusal brings waits; the next one (after aDecisionTaskCompletedthat follows the refusal) starts the same timer again;TIMER_CREATION_RATE_EXCEEDED: the same timer starts again at once;TaskFailedkeeps the task's cause asreason, with the timer and its cause indetails.OPEN_TIMERS_LIMIT_EXCEEDEDwaits too.do_handle_failure: the decision the refusal brings returns a pending future and no decision; a later one starts the timer again, as before.TIMER_CREATION_RATE_EXCEEDEDis unchanged.ActivityTaskCanceledandWorkflowExecutionCanceledare parsed.simpleflow/history.py: both branches testedcancelled; the state iscanceled.canceled, withcanceled_idandcanceled_timestamp.History.workflowhas statecanceled, withcanceled_id,canceled_timestamp,decision_task_completed_event_idanddetails.simpleflow/swf/stats/pretty.py(status,get_task,info) andsimpleflow/swf/helpers.py(find_activity) no longer raiseKeyErroron a refused schedule or on a cancel request for an unknown activity id.simpleflow workflow.inforeads histories that start with a signal.simpleflow/swf/stats/pretty.py:infotakes the first and last tasks' timestamps through a newget_task_timestamp, which also knows a signal'stimestampand a not-yet-started child workflow'sinitiated_event_timestamp.simpleflow workflow.infoshows the workflow's input.simpleflow/swf/stats/pretty.py: theinputcolumn comes fromWorkflowExecutionStarted, the first event, instead of the first task.tests/conftest.pyimportsmotobefore any test module.tests.data.constantscreates the SWF boto3 client at import and it is cached for the process; moto 4 only stubs clients created after its import. Run first,test_executor.pymade later@mock_swftests call the real SWF endpoint.TestSettingsrestoressimpleflow.settings: it leftMETROLOGY_PATH_PREFIX = "123", sotest_metrology, run after it, read from the wrong key.simpleflow/swf/mapper/models/history/builder.py: new helpersadd_marker_record_failed,add_activity_task_cancel_requested,add_activity_task_canceledandadd_workflow_execution_canceled.Why
Signals.
find_signal_eventlooked the task up by name inhistory.signalsbefore looking at its target. A workflow that had receiveda_signaland then submittedsignal("a_signal", workflow_id="other")got a finished future carrying the received input, and noSignalExternalWorkflowExecutiondecision was made. The other workflow never got the signal.Markers.
RecordMarkerFailedis parsed asrecord_failed, andfind_marker_eventkept onlyrecordedmarkers. A refused marker was never found, soRecordMarkerwas issued again on every decision. The only documented cause isOPERATION_NOT_PERMITTED, which does not go away by itself.Refused schedules. A
schedule_failedentry made the executor schedule the activity again in the next decision, whatever the cause. SWF answers a failed decision with a new decision task, so a permanent refusal looped until the execution hit its event cap, and a rate or limit refusal was retried at full speed. Two refused activities that were never scheduled also shared onehandled_failuresentry (get_event_idreturnedNonefor both), anddo_handle_failure's timer lookup raisedKeyErroron such an entry.Refused child starts. A refusal other than a missing type became a failed future through the default retry handling, which compares the history's
retrywith the child's; refusals never incremented it, so a child withretry > 0was started again on every decision until the event cap. A rate or limit refusal failed the attempt instead of waiting, and a missing type was created and started again at once, for ever if the refusal persisted.initiatedEventIdis 0 for every cause butWORKFLOW_ALREADY_RUNNING, so two refused children also shared onehandled_failuresentry.Refused backoff timers. When the backoff timer was refused, the task was tried again at once: under the open-activities and open-timers limits together, that was task refused, timer refused, task refused…, two decisions per turn.
Refused failure-retry timers.
do_handle_failure(#484) treated a retry timer refused forOPEN_TIMERS_LIMIT_EXCEEDEDas never started, andon_task_failurestarted it again in the same decision: timer refused, started again, refused…Canceled. Event states are the SWF event type minus its prefix, snake_cased, so both events give
canceled. The two parser branches never ran:cancel_requested,startedorscheduled). The executor's ownstate == "canceled"branch was unreachable, the future stayed pending, the activity kept counting as open, and a workflow waiting on it blocked;startedinHistory.workflow.CLI. A
schedule_failedentry with no earlier schedule has noid,name,version,inputnorscheduled_id. Acancel_requestedentry for an unknown activity id has only itsid. On such a history:workflow.tasksraisedKeyError('name');workflow.inforaisedKeyError('input')when the entry was the first task;task.inforaisedKeyError('id');activity.rerunraisedKeyError('scheduled_id')before reaching the activity asked for.inforeadf"{state}_timestamp"from the first and last tasks. A received signal only hastimestamp, and a child workflow that is initiated but not started only hasinitiated_event_timestamp. A history whose first task is a signal raisedKeyError('signaled_timestamp'), and one ending or starting on a child workflow waiting to start raisedKeyError('start_initiated_timestamp'). The last task already fell back totimestamp; the first did not.infoalso filled itsinputcolumn from the first task: the first activity's or child workflow's input, or the first received signal's. Only a history with no task showed the workflow's input.Choices
Executor.signalfills in the workflow's ownworkflow_idandrun_idwhen noworkflow_idis given, so a self-signal normally carries both. It keeps being found in the received signals, as before. A signal to the sameworkflow_idwith anotherrun_id(an earlier run of a continue-as-new chain) is a directed signal.futures.waitreturnsNonefor it; the refusal is infuture.exception.RecordMarkerFailedhas no details, so a refusal cannot be tied to oneMarkerTask. It stands for every marker of that name that has no recorded match. A recorded marker with the task's details always wins, whatever the order, so a history where a later attempt succeeded replays as recorded.get_event_details("marker", …)andlist_markersare unchanged.retry. For a permanent refusal, the failure context's event getsretry= earlier failures + refusals in a row − 1, the value a failed execution would have had, soattempt_numbercounts them. Each retry refused again raises it: the default handling stops afterretryattempts, and attempt-based stop strategies inon_task_failurestop too.WORKFLOW_ALREADY_RUNNINGis not transient. The running execution may be another one, running for an unbounded time; it stays a failed attempt, as it was.OPEN_TIMERS_LIMIT_EXCEEDEDis safe: the limit is per execution (1,000 open timers), so this execution's own timers will fire and bring a decision. A decision task timeout adds noDecisionTaskCompleted, so it waits again.decided_sincehelper.TIMER_CREATION_RATE_EXCEEDEDstill loops while SWF throttles. It is an account-wide token bucket (StartTimer: 2,000, refilled at 200/s), so nothing in the execution is sure to wake it: the timer starts again at once, paced by decision round trips. Same choice as the failure-retry timer (Start a refused retry timer again instead of failing the workflow on replay #484).__simpleflow_task_<id>). One open timer per waiting activity; their number is bounded by the activities the executor keeps open.cancelled_timestamp→canceled_timestamp, plus a newcanceled_id. The old key was never written, since its branch never ran, and it could not have been read either: stats and the CLI readf"{state}_timestamp".ActivityTaskEventDictfollows. The workflow branch already derived its keys from the state.futures.waitreturnsNonefor it, and canvas groups and chains seecancelled.idandnameon a refused schedule, but it cannot for the cancel request, and its entries also feed the decider. Changing the four readers is the smaller change and stays off the decision path.statusshows the name, else the refused activity type's name, else the activity id.find_activityskips entries that were never scheduled: there is nothing to run again. Asking for one gives the usualCouldn't find activity.Tests
New tests, built with
simpleflow.swf.mapper.models.history.builder.History:tests/test_simpleflow/swf/test_executor.pyTestSentSignalReplay:workflow_id, ownworkflow_idandrun_id) is found in the received signals;workflow_idis sent.TestRefusedMarkerReplay:RecordMarkerdecision and aTaskFailed("a_marker", "OPERATION_NOT_PERMITTED")future;TestRefusedScheduleReplay:ACTIVITY_TYPE_DOES_NOT_EXISTcreates the type and schedules again at once (control), and the type is created again on a later refusal (control);ACTIVITY_TYPE_DOES_NOT_EXIST, give aStartTimerand noScheduleActivityTask;retry=2, two refusals are rescheduled and the third fails the workflow;on_task_failurewith the cause, the activity id inevent["id"]andattempt_number == 1;TestRefusedChildStartReplay:WORKFLOW_TYPE_DOES_NOT_EXISTcreates the type and starts the child again at once (control);WORKFLOW_TYPE_DOES_NOT_EXIST, give aStartTimerand noStartChildWorkflowExecution;retry=2, two permanent refusals are started again and the third fails the workflow;on_task_failurewith the cause, the workflow id andattempt_number == 1(control: this already worked);TestRefusedBackoffTimerReplay(it replaces a test that pinned the immediate reschedule):OPEN_TIMERS_LIMIT_EXCEEDED, for an activity and a child workflow: no decision right after the refusal, then the sameStartTimer(id and delay) once another event brought a decision;TIMER_CREATION_RATE_EXCEEDED, for both: the sameStartTimerat once;OPERATION_NOT_PERMITTED: an optional activity's future fails with the task's cause and the timer's indetails; a mandatory one fails the workflow; withretry=2, the third refusal fails it.TestCaseNotNeedingDomain.test_a_retry_timer_refused_for_too_many_open_timers_waits_for_the_next_decision, after 0 and 1 earlier retries: no decision right after the refusal nor after a decision task timeout, then the sameStartTimeronce another event brought a decision.TestCanceledReplay:canceled_id,canceled_timestampanddetails;tests/test_simpleflow/swf/stats/test_pretty.py:status,get_taskandinfoon a history with a refused schedule, a cancel request for an unknown id and a scheduled activity;info's execution time with a signal as the only task, a signal before an activity, and an activity before a child workflow that is only initiated;info's input with an activity first, a signal first, and no task (control).test_infoabove pinned the first task's input (None) and now expects the workflow's ({}).tests/test_simpleflow/test_helpers.py:find_activityskips never-scheduled entries and still finds the scheduled one byscheduled_idoractivity_id.Results:
KeyErrors listed above;infotimestamps: all 3 fail, withKeyError('signaled_timestamp')orKeyError('start_initiated_timestamp');infoinput: the activity-first and signal-first tests fail with the task's input; the no-task control passes;retry=2starts the child for ever, both children get the first cause); the 2 controls pass;uv run --frozen --all-extras --group=dev pytest): 495 passed, 10 skipped, 3 xfailed (508 collected). The same withAWS_CREDENTIALSset in the shell, which used to send 3 tests to the real SWF.test_executor.pyalone: 3 failed,UnrecognizedClientExceptionfrom the real SWF;test_executor.py+test_dataflow.py -k "Refused or schedule_failed":test_activity_not_found_schedule_failedfailed the same way;test_metrologyfailed with aHeadObject404 (the oldtest_settings.pythentest_metrology.pyreproduces it).uvx prek run --all-filesis clean.Not addressed
🤖 Generated with Claude Code