Repository navigation
test(workflows): stop counting schema lookups in the step-runs query test - #805
Merged
Merged
Conversation
…test The test compares the step_runs queries of a two-step start with those of a five-step one. Its /step_runs/ match also caught the two SCHEMA queries that load the table's columns, which run only on the first call in a process. So the test failed whenever it ran before anything else had touched StepRun: always when run alone (5 vs 3), and on CI when the random order put it first in its worker (4 vs 3, flow #803). It now skips SCHEMA queries, as the other query-counting tests do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Nov 20, 2026
* origin/docs/session-restore-and-sharing-research: feat(sessions): suspend interactive sessions and restore them within 30 days docs(design): suspend and restore interactive sessions docs(research): restoring an ended session and sharing a live one test(workflows): stop counting schema lookups in the step-runs query test (#805) chore(agents): raise agent CLI pins for canary #675 (#804) docs(runners): tell manual machine owners to block the SCTP module (#803) fix(deps): weekly dependency batch — puma 8.1.2 advisories, stripe 21.1, Mantine 9.8.1, jsdom 31 (#799) docs(runners): record the second manual runner validation in row 14 (#797) docs(runners): tech design of the Go relay service for the interactive tunnel (#796) chore(runners): pin aixle-runner 0.4.1 as the recommended version (#795) # Conflicts: # CHANGELOG.md
Merged
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.
Why
WorkflowServiceTest"a run's step runs are created pending, in step order, at a cost that does not grow with the steps" failed on the docs-only #803 (Expected: 4, Actual: 3, Rails shard 3/3) and passed on rerun.The test counts queries matching
/step_runs/during a two-step start and again during a five-step start, then compares the two counts. The match also catches the twoSCHEMAqueries Active Record runs to loadstep_runs' columns (… WHERE a.attrelid = '"step_runs"'::regclass). Those run only on the first call in a process, so they land in the two-step count and never in the five-step one.Expected: 5, Actual: 3. Reproduced 3 of 3 ondevelop.StepRun.The counted queries on a cold process, logged during the investigation:
What
The counter skips
SCHEMAand cached queries, as the other query-counting tests already do (project_teams/picker_test.rb,internal_tools/session_tools_test.rb,personal_tools/list_sessions_test.rb). The assertion itself is unchanged: the five-step start must cost as manystep_runsqueries as the two-step one.I checked the other tests that subscribe to
sql.active_record. They either filterSCHEMAalready or match a specificFROM "<table>"/UPDATEstring that schema lookups do not contain, so this test is the only one with the problem.Checks
All run in Docker against a private Postgres, with
PARALLEL_WORKERS=1:bin/rails test test/services/workflow_service_test.rb:48alone: 3 of 3 pass. Before the fix, 3 of 3 failed.rubocopon the file: no offenses.Test-only change, so no changelog entry.
🤖 Generated with Claude Code