Repository navigation
bug: flaky trace assertion in scheduler activation test #2071
Description
Describe the bug
test_scheduler_activation_drops_finished_startup_request[memory] failed in the Python 3.11 CI job, then passed when that job was rerun on the same commit without code changes. This intermittently blocks PR checks and requires a manual retry.
The likely cause is an assumption about the number of scheduler activations. The test schedules work every 20 ms and compares every completion log's trace ID with the first root span's trace ID. However, each activation creates an independent trace root.
The failed run captured two completion logs, which is consistent with multiple activations reaching the assertion. This explanation still needs confirmation: the failure output does not include the individual trace IDs.
Steps to reproduce
-
Use commit
5ecdbc4dcdee574109ec2332e6cc2bad822eedb1. -
Run the unit suite in the Python 3.11 environment configured by the Main workflow:
PYTEST_WORKERS=4 make unit-test
-
Check the scheduler activation test's trace ID assertion.
This is intermittent. One failure has been observed in the full CI suite; a deterministic minimal reproduction has not been established. Rerunning the failed job on the same commit passed.
Expected behavior
The test should tolerate multiple valid activations and verify that each completion log corresponds to its own background root trace. It should continue to check that the startup request ID does not leak and that scheduled root spans have no parent.
Actual behavior
The assertion at tests/builtin/runtime/test_scheduler.py:580 failed:
assert all(r.trace_id == format(roots[0].context.trace_id, "032x") for r in records)The captured log contained two entries:
INFO powercontext.builtin.runtime.application:_logging.py:94 Scheduled background processing completed
INFO powercontext.builtin.runtime.application:_logging.py:94 Scheduled background processing completed
The preceding assertions for successful outcomes, cleared request IDs, and parentless root spans all passed.
| Execution | Result |
|---|---|
| Attempt 1: failed job | 1 failed, 4963 passed, 151 skipped |
| Attempt 2: same commit, rerun | 4964 passed, 151 skipped |
Environment
- Commit:
5ecdbc4dcdee574109ec2332e6cc2bad822eedb1 - GitHub Actions: Main /
tests (3.11, unit), run39210212970, October 19, 2026 - OS: Linux (
ubuntu-latest) - Python: 3.11.17
- pytest: 9.1.1
- pytest-xdist: 4 workers, 5115 collected tests
- Related PR: refactor(cli): unify agent installation lifecycle #2052
Are you willing to submit a PR to fix this bug?
- Yes, I would like to submit a PR.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Skylm808 commentedon Oct 19, 2026
请分配给我
AlexStocks commentedon Oct 19, 2026
@Skylm808 done. just do it. and do it quickly ^_^