Skip to content

TEST: Stabilize scenario estimate readiness coordination - #3364

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-scenario-estimate-readiness-fix
Oct 20, 2026
Merged

Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-scenario-estimate-readiness-fix

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Two scenario estimate tests still impose one-second readiness/completion limits that can fail on busy runners. These waits were not covered by #3273. Both tests pass on an ordinary fresh-main run, but controlled 1.1-second fake-worker delays reproduce the failures reported in the catalog readiness job and the configured completion job.

  • Explicitly observe the second catalog estimate waiting for semaphore admission before checking that only the first execution deadline has started.
  • Verify that a configured estimate finishes while catalog capacity remains occupied and the catalog request is unfinished.
  • Reuse the existing finite estimate test watchdog, release event gates and drain owned requests/workers in finally, and assert task cleanup.

Production code and deadlines are unchanged. No retries, skips, or weaker semantic assertions are introduced.

Tests and Documentation

Updated the two assigned estimate tests and documented their coordination and cleanup pattern in doc/contributing/4_running_tests.md.

  • uv run --frozen python -m pytest tests\unit\backend\test_scenario_service.py -q: 78 passed, with 9 existing dataset deprecation warnings.
  • uv run --frozen ruff check tests\unit\backend\test_scenario_service.py: passed.
  • uv run --frozen ruff format --check tests\unit\backend\test_scenario_service.py: passed.
  • git --no-pager diff --check HEAD^ HEAD: passed.
  • Commit hooks, including documentation validation: passed.

Additional offline probes, kept outside the repository, reproduced the old readiness and configured-completion failures with delayed mocked workers. Both repaired tests pass the same delays without leaked estimates. In-memory fault injection confirmed that the tests still reject deadlines started before admission and configured work sharing catalog capacity; failure-path cleanup also passed. No live providers were used.

JupyText: not run; no notebooks or executable documentation changed.

Observe queued catalog admission explicitly and verify configured estimates complete while catalog capacity is occupied. Reuse the finite estimate test watchdog and drain owned work on all exit paths without changing production deadlines.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 73d7c38f-5387-4c8d-b0ac-9fba6a515449
Comment thread tests/unit/backend/test_scenario_service.py
Comment thread tests/unit/backend/test_scenario_service.py
Count successful catalog admissions before each execution timeout starts, and spy on catalog semaphore acquisition during configured estimates. Address both review suggestions without adding latency assertions or changing production behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 73d7c38f-5387-4c8d-b0ac-9fba6a515449
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 20, 2026
Merged via the queue into microsoft:main with commit 54dbb95 Oct 20, 2026
65 checks passed
@romanlutz
Roman Lutz (romanlutz) deleted the romanlutz-scenario-estimate-readiness-fix branch October 20, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants