Make CI actually run, and cover L2/L3 nightly - #161
Merged
Merged
Conversation
unit_tests.yml had failed on main for months: it expected SNOW_INSTANCE_* secrets that no longer exist, lacked the HF token the instance pool needs, and black flagged src/wa_action_traces.py. PRs now run only the fast suite against the pool (42 tests, about a minute); the slow and weekly end-to-end jobs, which would otherwise run for hours, move to a nightly shard. instance_pool_ci.yml gains: - a nightly shard of the slow and compositional tests: one seventh per weekday so the full suite runs weekly, with the seed rotated daily and reported in the job summary (tests/conftest.py adds WORKARENA_TEST_SHARD, and test_compositional.py reads WORKARENA_TEST_SEED) - a pool health check (tests/test_instance_preconditions.py) that verifies, on every instance, the catalog preconditions the task code relies on. It reads the item names from the task classes; CATALOG_ITEM_SYS_NAMES in dash_do_base.py replaces two identical local copies so it can be imported. test_cheat_compositional now retries only on TimeoutError, as its log message always claimed, and warns on each retry so flakiness is visible. Retrying on any exception hid the L2 instance-binding bug. Also fix two tests that silently used several random pool instances at once: SNowInstance replaces credentials passed without a URL. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds test_catalog_matches_other_instances to the nightly pool health check: for every instance, flag catalog items that are missing or extra relative to the majority of the pool, and content fields (name, sys_name, active, category, price, short_description, sc_catalogs, order) that disagree with the majority, reporting who last updated each record. sys_updated_on and similar fields churn legitimately and are not compared. Drift shared by most instances goes unnoticed by design. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per-PR CI has been dead for months. Every
unit_tests.ymlrun onmainsince at least March 2026 failed, for three independent reasons:SNOW_INSTANCE_URL/UNAME/PWDsecrets that no longer exist. Undefined secrets resolve to'', so tests failed withInvalid URL ''.HUGGING_FACE_HUB_TOKEN, so the tests that load the instance pool errored at collection with a 401.src/wa_action_traces.py.In practice the "fast" job ran about 16 tests in 8 seconds, and L2/L3 compositional tasks never ran in CI at all.
This PR:
Per-PR (
unit_tests.yml): uses the instance pool through the existing HF token and runs only the fast suite: 42 tests, about a minute. Theslow(833 selected, about 265 not permanently skipped) and weekly end-to-end (682) jobs are removed. Revived as-is, they'd take roughly 45 minutes per PR and about 4 hours per week, so they move to the nightly shard below. Nothing is lost relative to today, since neither job has run in months.Nightly shard (
instance_pool_ci.yml): the slow and compositional tests, one seventh per weekday (about 105 runnable tests at-n 20), so everything runs once a week. The seed rotates daily instead of always being 0. The shard and seed are written to the job summary so a failure can be reproduced exactly. The job runs after the L1 jobs rather than alongside them, to spread load on the shared pool. L1 (test_task_general.py) is excluded because it already runs in full nightly. Supported byWORKARENA_TEST_SHARD(newtests/conftest.py) andWORKARENA_TEST_SEED(test_compositional.py).Pool health check (
tests/test_instance_preconditions.py, nightly, API-only, about 8s): checks on every instance the catalog preconditions the task code relies on, instead of trying to model the whole instance. Each rule is as strict as the code it guards:h2:has-text(a case-insensitive substring match);sys_name=Table API query (case-insensitive) resolves to exactly one item;!=(case-sensitive) exists with that exactsys_name.Names are read from the task classes themselves, so the check follows the code. To make that possible,
CATALOG_ITEM_SYS_NAMESindash_do_base.pyreplaces two identical local copies of the same dict. This is behavior-preserving.It also compares each instance's catalog against the rest of the pool: items missing or extra relative to the majority, and content fields (name,
sys_name, active, category, price, description, catalogs, order) that disagree with the majority. Each problem is reported with the user who last updated the record.sys_updated_onand similar fields churn legitimately and aren't compared. Drift shared by most instances goes unnoticed by design.Retries:
test_cheat_compositionalnow retries only onTimeoutError, as its log message always claimed, and emits a warning on each retry so flakiness shows up even when a test passes. Retrying on any exception is what hid Bind L2 compositional subtasks to the parent's instance #160's bug.Two tests fixed: they silently used several random pool instances at once.
SNowInstancereplaces credentials passed without a URL. See below.Findings from this work
The health check found live contaminations on its first runs, all traced to agent-generated users:
workarenapublic22:Apple iPhone 13 prowas renamed toApple iPhone 13 Proon 2026-09-10 byJessica.Rodriguez.8270, along with itsshort_description. The…RequestAppleIphone13proTaskvalidation compares with!=, so those tasks failed whenever they landed there. Repaired in place; renaming it back also resyncedsys_name.workarenapublic22and23:Windows Surface Pro 4is active while 4/6 instances have it inactive, set byNicole.Shaw.6191andAlexander.James.6191. The same…6191suffix asAnna.Weaver.6191, who activatedApple Watch Series 2on instance 20: both items are inactive items that the request tasks ask agents to order. Instance since removed from the pool.workarenapublic20: two blank-named catalog items that exist on no other instance, created on 2026-07-28 byMarc.Nash.7331. Instance since removed from the pool.Screening also found 40–50K orphaned task users on each of 20/22/23, plus the data they created (89% of
taskrecords on instance 20). So 20/22/23 were removed from the pool to be reprovisioned rather than cleaned. On the current pool (25/26/27) the health check passes 87/87.Replaying the two earlier contaminations (Apple Watch Series 2 active on instance 20; Loaner Laptop
sys_nameresynced on 19) through the same checks flags each with one precise failure, and a healthy catalog passes 28/28.SNowInstancefootgun: passingsnow_credentialswithoutsnow_urlsilently replaces the credentials with an env or pool instance's admin credentials. Library code is safe (the installer's wrapper always passes both), but it's easy to misuse. Consider raising instead; that's left for a separate PR.The 72 infeasible dashboard-catalog tasks are neither registered in the benchmark nor tested. FYI in case that's unintended.
Test plan
TimeoutErroris retried with a warning, whileIndexErrorfails on the first attempt.CATALOG_ITEM_SYS_NAMES(including the Loaner Laptop mapping) pass.black . --checkwith CI's pinnedblack==24.2.0is clean.workflow_dispatch, will confirm the workflow wiring. This PR's ownunit_tests.ymlrun exercises the new per-PR job.🤖 Generated with Claude Code