feat(testing): add skip-time virtual clock#523
Open
yaythomas wants to merge 3 commits into
Open
Conversation
5c208f2 to
355edf1
Compare
346a870 to
2e9ba2b
Compare
355edf1 to
27adefe
Compare
Replace the per-ARN lock with a per-execution worker that runs every operation for one execution one at a time on its own serial lane. - Worker model: SerialTaskLane, ExecutionWorker, ExecutionRegistry, ExecutionTask, CallableTask. - One checkpoint write transaction in checkpoint/core.py shared by the web and in process paths. - Checkpoint lifecycle actions returned as effects applied after the write. The reentrant notifier is gone. - The invocation gate lives on the worker status. - The blocking invoke runs off the lane so handler callbacks can run. - Store integration test on memory, filesystem, and sqlite. Caught and fixed a non-atomic write in FileSystemStore. - Runner accepts an optional store for store injection testing. - docs/architecture.md: new, describes the worker model. Closes #435
- Add ExecutionRegistry.submit with compare-and-evict retry so a worker that stops its lane between hand-out and submit no longer surfaces RuntimeError; reorder teardown to stop-then-remove. - Add ExecutionRegistry.shutdown; WebRunner.stop and DurableFunctionTestRunner.close now stop per-execution lanes so they do not outlive the runner. - Honor MaxItems in GetDurableExecutionState, clamped to the service page-count bounds, via the paginator's new count bound. - Remove dead _release_gate and _cleanup_execution_state; fix logger.exception misuse on non-error paths; fix the wait_for_callback timeout message.
9829546 to
71962f1
Compare
2e9ba2b to
d2f04f2
Compare
- Add Clock protocol with RealClock and SkipClock implementations - Give each ExecutionWorker its own clock via the registry factory - Drive wait and step-retry timers off the clock so modeled delays complete instantly under skip while history keeps real durations - Default DurableFunctionTestRunner to skip_time=True; pass skip_time=False for real wall-clock timing - Remove the DURABLE_EXECUTION_TIME_SCALE env-var scaling
d2f04f2 to
c494657
Compare
zhongkechen
reviewed
Jul 9, 2026
| scheduled_end_timestamp = datetime.now(UTC) + timedelta( | ||
| seconds=scaled_wait_seconds | ||
| seconds=wait_seconds | ||
| ) |
Contributor
There was a problem hiding this comment.
It is still using the real time here, which causes the operation after the wait operation to have a start time stamp earlier than the scheduled end time of wait. This confuses the timeline of the history. Not sure if this is the desired behavior.
71962f1 to
11103e3
Compare
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.
Description of changes:
Issue #, if available:
closes #437
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.