[PR #1901] [Other] synchronize the keepawake service test with its worker #3749

Open
opened 2026-11-07 15:30:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 4ea61c1 test: synchronize keepawake service fixture with its worker
  • fe62b46 Merge 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.

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.2 011c9e600a93bbc9fd451c563501b5831c32bbca, 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 calls wait_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:

  • The unmodified current-main fixture failed its expected ON/OFF assertion under the same controlled ordering, reproducing the regression. This was the intentional baseline case, not a candidate failure.

Not run:

  • Real Windows power-state / suspend-resume testing and GPU/backend builds: this change only fixes a mocked Python fixture.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1901 **Author:** [@midhatn](https://github.com/midhatn) **Created:** 10/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/keepawake-test-scheduling` --- ### 📝 Commits (2) - [`4ea61c1`](https://github.com/Niko1221/Strata/commit/4ea61c1500d4525efded784eac585ef7833e556f) test: synchronize keepawake service fixture with its worker - [`fe62b46`](https://github.com/Niko1221/Strata/commit/fe62b46eaf6b3e0388d1395bf8de6057b41127ff) Merge remote-tracking branch 'origin/main' into codex/pr1901-refresh-20261023 ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_keepawake.py` (+8 -1) </details> ### 📄 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.2 `011c9e600a93bbc9fd451c563501b5831c32bbca`, 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 calls `wait_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:** - The unmodified current-main fixture failed its expected ON/OFF assertion under the same controlled ordering, reproducing the regression. This was the intentional baseline case, not a candidate failure. **Not run:** - Real Windows power-state / suspend-resume testing and GPU/backend builds: this change only fixes a mocked Python fixture. ## Limits This validates the test's synchronization and cleanup, not actual power management or model behavior. No performance claim. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3749
No description provided.