Repository navigation
Conversation
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.
run_all(delay_seconds=10)currently sleeps after the final job, including when only one job is scheduled. With two immediate jobs, the call waits 20 seconds although the documented delay is between jobs.Move the sleep before the second and subsequent jobs. The first job still starts immediately, jobs remain separated by the requested delay, and the method returns when the last job finishes. Iteration still uses
self.jobs[:], preserving the existing snapshot behavior when a callback adds or removes jobs.Added regressions use mocked sleep to verify the event sequence for zero, one, and three jobs, plus a callback that clears and replaces the schedule. The original implementation fails three assertions; the change makes them pass without waiting in real time.
Validation on Ubuntu 24.04 (WSL), CPython 3.12.3:
python -m pytest test_schedule.py schedule -q --cov schedule --cov-report term-missing: 83 passed, 3 subtests passed, including the timezone tests; 99% coverage.python -m mypy -p schedule: no issues in 1 source file.--check.git diff --checkpasses.OpenAI Codex assisted with the investigation, patch, tests, and this description. The reported checks were executed locally.