mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1901] [Other] synchronize the keepawake service test with its worker #3749
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3749
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1901
Author: @midhatn
Created: 10/10/2026
Status: 🔄 Open
Base:
main← Head:codex/keepawake-test-scheduling📝 Commits (2)
4ea61c1test: synchronize keepawake service fixture with its workerfe62b46Merge remote-tracking branch 'origin/main' into codex/pr1901-refresh-20261023📊 Changes
1 file changed (+8 additions, -1 deletions)
View changed files
📝
serve/test_keepawake.py(+8 -1)📄 Description
Problem and result
A short mock request can finish before the asynchronous keepawake worker observes it. The test then expects an ON/OFF pair that the worker never had to emit. Keep the request generator open until the fake Windows call records ON, then finish the request and check OFF.
Related discussion
Existing PR #1901; refreshed for the October 19 tracker reset. This is a focused test-fixture fix.
Approach
Wait after the first generator yield and register cleanup for the worker and both generators. The diff against current main changes only
serve/test_keepawake.py(8 additions, 1 deletion); production keepawake code and defaults are unchanged.Validation
Tested head
fe62b46eaf6b3e0388d1395bf8de6057b41127ff, incorporating current main / v0.2.2011c9e600a93bbc9fd451c563501b5831c32bbca, on Windows with Python 3.11.9.Passed:
python -B -m unittest serve.test_keepawake -v: all 6 tests passed.python -B check_pr1901.py(local deterministic scheduling harness): delay the keepawake worker on an event until the fixture first callswait_for. The corrected fixture passed all 5 runs; the full 6-test suite also passed with the real Windows power API forbidden.git diff --check origin/main: passed.Failed:
Not run:
Limits
This validates the test's synchronization and cleanup, not actual power management or model behavior. No performance claim.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.