fix(testing): reject blank execution ARNs - #636
Conversation
bcbdfde to
9632f07
Compare
Codex AI reviewNo actionable findings. Residual risk: whitespace-only ARNs are covered at the Reviewed commit |
Claude AI reviewNo actionable findings. This PR adds I verified:
Minor non-blocking nit (not filed): the docstrings of Residual test risk is minimal — the change is small, purely additive input validation, and every wired call site (including the phantom-worker regression) is exercised. Reviewed commit |
Co-authored-by: thomas <18520168+yaythomas@users.noreply.github.com>
b41ffd7 to
033b5fd
Compare
|
thank you so much @SravyaPeri! welcome to dex! I tweaked the err msg and method name... ,just waiting for CI and then ready to merge. |
|
closes #461 |
Issue #, if available:: #461
Description of changes:
This PR adds execution ARN validation to the in-memory
Executorused by the local test runner. Two things were missing:None/empty/whitespace-onlyexecution_arnwas never rejected before reaching store/registry internals.get_execution_state,stop_execution, andcheckpoint_executionall callself._registry.submit(execution_arn, ...), which callsget_or_create(), so a bad ARN silently registered a permanent phantom worker (with its own thread/lane) before the existence check inside the task body ever ran and raisedResourceNotFoundException.Note on scope: this runner's execution ARNs are opaque local identifiers (
Execution.new()generatesf"{uuid4()}/{invocation_id}"), not real AWS ARNs — confirmed by checking that neither the runtime code nor the existing test fixtures (e.g.executor_test.py) use the realarn:aws:lambda:...:function:.../durable-execution/.../...shape. So thisvalidates blank/non-string input rather than checking AWS ARN structure, which would have rejected legitimate executions.
Changes:
Executor._require_valid_arn(): raisesInvalidParameterValueExceptionfor a blank/non-string ARNget_execution,stop_execution,get_execution_state,checkpoint_execution, beforeregistry.submit()in the latter three, closing the phantom-worker leakregistry.active_count() == 0after a rejected callBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.