Skip to content

Commit 8beb520

Browse files
rustyconoverclaude
andcommitted
test(fixtures): write planned_days_last_plan.json only for planning calls with predicates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5e85bc2 commit 8beb520

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎vgi/_test_fixtures/worker.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,9 +2388,13 @@ def _planned_days_branches(name: str, filters: ScanPlanningFilters | None) -> Sc
23882388
"""Branches for the protocol 3.2 planned_days* fixtures (see _PLANNED_DAYS)."""
23892389
if name == "planned_days":
23902390
days = [d for d in _PLANNED_DAYS if filters is None or filters.may_match(_planned_day_stats(d))]
2391-
# Record what the worker saw so tests can assert the predicates arrived.
2392-
with open(f"{_BRANCH_DIR}/planned_days_last_plan.json", "w", encoding="utf-8") as fh:
2393-
json.dump({"received_filters": filters is not None, "days": [d.isoformat() for d in days]}, fh)
2391+
# Record what the worker saw so tests can assert the predicates arrived. Only
2392+
# planning calls that carried predicates write it: vgi_table_branches() and
2393+
# other filterless fetches run concurrently in parallel test lanes and must
2394+
# not overwrite the record a filtered query's test is about to read.
2395+
if filters is not None:
2396+
with open(f"{_BRANCH_DIR}/planned_days_last_plan.json", "w", encoding="utf-8") as fh:
2397+
json.dump({"received_filters": True, "days": [d.isoformat() for d in days]}, fh)
23942398
if not days:
23952399
return ScanBranchesResult(branches=[], required_extensions=["parquet"])
23962400
return ScanBranchesResult(

0 commit comments

Comments
 (0)