Skip to content

feat(tools): add advanced queue, state, and resilience assertions to xmc validator - #868

Merged
janzak-dev merged 3 commits into
feat/nightly-validation-toolingfrom
feat/nightly-validation-advanced
Sep 14, 2026
Merged

janzak-dev merged 3 commits into
feat/nightly-validation-toolingfrom
feat/nightly-validation-advanced

Conversation

@janzak-dev

@janzak-dev janzak-dev commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Stack Navigation

Layer PR Branch Base Status
Layer 1A #862 feat/nightly-validation-basic / feat/nightly-validation-tooling main 🔄 Ready for Review
Layer 1B (This PR) #868 feat/nightly-validation-advanced feat/nightly-validation-tooling 🔄 Draft
Layer 2 #852 feat/nightly-test-suite feat/nightly-validation-advanced ⏳ Draft

Summary

Adds advanced queue constraint extraction, WorkUnit state assertions, completion polling with transient error resilience, and terminal failure fail-fast behavior to xmc_entities_validator.py and demo_workload_verify.py.

Motivation & Context

Layer 1B in the nightly workload validation stack builds upon the basic validator (Layer 1A / PR #862). It equips the test harness with real-world resilience: polling until WorkUnits reach terminal COMPLETED state, asserting expected scheduling queue placement (cpu-queue), detecting execution failures fast via TerminalFailureError, retrying transient gRPC connection errors, and resolving UI deep-links.

Key Changes

  • State Constants & Mappings: Added STATE_NAMES enum mapping and state_enum_to_name() helper.
  • Queue & State Extraction: Added extract_queue_name() and extract_work_unit_state() resolving status from current execution or ESS query.
  • Resilient Polling: Updated validate_work_units() with exponential/linear retry polling loop, count threshold validation, and TerminalFailureError fail-fast.
  • Title Pattern Assertion: Updated validate_experiment() to assert expected_title_pattern.
  • UI Origin Resolution: Added resolve_ui_base_url() supporting custom domains, Cloudtop environments, and fallback ports.
  • CLI Enhancements: Updated demo_workload_verify.py with queue assertions, title verification, and completion reporting.
  • Unit Tests: Added 11 new unit test cases covering all advanced assertions, transient retries, fail-fast mechanics, and URL resolution.

Assumptions

None — requirements were fully specified.

Screenshot of a local run

image

Verification & Testing

  • Commands Executed:
    • bazel test //tools/nightly_tests:all (Passed: 1/1 test targets passed)
    • ./.githooks/pre-commit (Passed all lint, buildifier, gofmt, addlicense, and ruff checks)
    • ./tools/analyze_diff_size.py --base-ref feat/nightly-validation-basic... (Prod: 275 lines, Total: 636 lines — within all thresholds)

Related Issues / Bugs

N/A

TAG=agy
CONV=dbcea664-0b27-47b6-894c-5cd2431fec9f

@janzak-dev
janzak-dev changed the base branch from feat/nightly-validation-basic to feat/nightly-validation-tooling September 14, 2026 08:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the nightly workload verification script and its validation library to support polling work units until they reach a terminal state, verifying their target queues, and matching experiment titles. Feedback on these changes highlights a few critical issues: first, catching AssertionError during polling prevents failing fast on static metadata mismatches (like queue or worker name mismatches) and unnecessarily waits for the timeout; second, checking the truthiness of the state enum values causes 0 (STATE_UNSPECIFIED) to be treated as falsy, triggering redundant fallback gRPC calls or failing to return the correct state.

@janzak-dev
janzak-dev added this pull request to stack #869 September 14, 2026 08:01
@janzak-dev
janzak-dev force-pushed the feat/nightly-validation-advanced branch 3 times, most recently from 33d1d64 to 7c5f6ec Compare September 14, 2026 08:33
@janzak-dev
janzak-dev marked this pull request as ready for review September 14, 2026 08:48
@github-actions
github-actions Bot requested a review from AntonTyb September 14, 2026 08:48
@janzak-dev
janzak-dev requested review from andrzejfudro and removed request for AntonTyb September 14, 2026 08:49
@janzak-dev janzak-dev added the priority::2-high top of mind. should not wait. label Sep 14, 2026
andrzejfudro
andrzejfudro previously approved these changes Sep 14, 2026
…xmc validator

Enhance `xmc_entities_validator.py` with comprehensive validation capabilities:
- WorkUnit state lifecycle tracking, terminal failure fail-fast (`TerminalFailureError`), and queue constraint validation.
- Transient network error retry loops and title regex pattern matching.
- XMC UI origin URL resolution (`resolve_ui_base_url()`).
- Updated `demo_workload_verify.py` CLI to enforce queue constraints, title pattern, and state completion polling.
- Comprehensive unit tests covering state mapping, failure states, retry timeouts, and UI URL resolution.

TAG=agy
CONV=dbcea664-0b27-47b6-894c-5cd2431fec9f
@janzak-dev
janzak-dev force-pushed the feat/nightly-validation-advanced branch from 9289736 to 9ca7ca6 Compare September 14, 2026 11:12
@janzak-dev
janzak-dev added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit 6ef44e2 Sep 14, 2026
11 checks passed
@janzak-dev
janzak-dev deleted the feat/nightly-validation-advanced branch September 14, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority::2-high top of mind. should not wait.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants