fix(testing): scale local durable timers#501
Open
zhongkechen wants to merge 4 commits into
Open
Conversation
Contributor
|
I'm not against this change since you're already done the work but barring more comments, I think it would be better to just port the "skip time" functionality from the other testing libraries |
Contributor
Author
This is different from Java as the way python test cases interact with the execution is different. In Java local test runner, the runner stops execution after each invocation and waits for user interaction while pythons runner runs execution concurrently when user interacts with the execution. |
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.
Summary
DURABLE_EXECUTION_TIME_SCALEhelper for local durable test timers.0.05scale so modeled durable delays do not spend unnecessary wall-clock time in CI.time_scale="1.0"because they intentionally test real heartbeat timing.Context
These commits were split out from PR #498. They are not part of the root-cause fix for the scheduler hang or the Python 3.13/3.14 callback race; those remain in PR #498.
This PR keeps the timer scaling change separate so it can be reviewed as a test-duration improvement for local durable timers.
Changes
aws_durable_execution_sdk_python_testing.time_scale.DURABLE_EXECUTION_TIME_SCALEinline.max(scaled_delay, min(original_delay, 5s))for long callback timers.Verification
hatch fmt --checkhatch run types:checkgit diff --checkhatch run test:all packages/aws-durable-execution-sdk-python-testing/tests/checkpoint/processors/wait_test.py packages/aws-durable-execution-sdk-python-testing/tests/checkpoint/processors/step_test.py packages/aws-durable-execution-sdk-python-testing/tests/executor_test.py -q- 138 passedhatch run test:all packages/aws-durable-execution-sdk-python-examples/test/callback/test_callback_heartbeat.py packages/aws-durable-execution-sdk-python-examples/test/wait_for_callback/test_wait_for_callback_heartbeat.py -q- 2 passedNote: the heartbeat example run still shows the existing
asyncio.iscoroutinefunctiondeprecation warning frommain; that warning is fixed separately in PR #498.