Make test_migration_0061 query plan assertion deterministic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start with server/tests/test_migration_0061.py, especially test_max_assigned_at_of_the_yield_uses_the_index and its EXPLAIN assertion. Read how the test sets planner options and creates its database state, then choose an approach that makes the result independent of close planner costs. Done means the assertion is deterministic and the test passes 20 consecutive runs against a clean database, with no schema, migration, or application changes.
Written by the indexing model from the issue text.
Description
Problem
test_max_assigned_at_of_the_yield_uses_the_index is flaky (server/tests/test_migration_0061.py:81). It asserts that the plan of the per-worker max(assigned_at) query contains Index Only Scan Backward using te_worker_assigned_idx (server/tests/test_migration_0061.py:116). It failed once in CI and passed when the same job was re-run on the same commit. In the failing run the planner chose Index Scan using task_executions_attempt_uk under an Aggregate.
The test turns off sequential and bitmap scans only (server/tests/test_migration_0061.py:103, server/tests/test_migration_0061.py:104). It runs on a table with no rows and no fresh statistics. The likely cause is that two index paths then cost about the same and the planner can pick either.
Proposed change
Make the test independent of the planner's choice. Options:
- Insert enough rows for the worker and for other workers, run
ANALYZE task_executions, thenEXPLAIN. - Or keep the plan check but also fix the planner settings for the test so that only the intended index is a candidate.
- Or assert the property that matters, that the index exists with
(worker_id, assigned_at)columns in order and that the query returns the right value, and drop the plan text check.
Acceptance criteria
- The test no longer depends on which index the planner picks when costs are close.
- The test passes 20 consecutive runs against a clean database.
- No schema, migration or application code changes.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
[Resource]: SpaicelyOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bvis/aegis-hass#725 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day