Skip to content

test(terminology): poll for async ITC propagation to de-flake schema/auth races#1474

Merged
kriszyp merged 3 commits into
mainfrom
kris/flake-terminology
Jul 1, 2026
Merged

test(terminology): poll for async ITC propagation to de-flake schema/auth races#1474
kriszyp merged 3 commits into
mainfrom
kris/flake-terminology

Conversation

@kriszyp

@kriszyp kriszyp commented Jun 24, 2026

Copy link
Copy Markdown
Member

De-flakes terminology.test.mjs, which was failing ~50% of CI runs with varying line numbers due to two async ITC-propagation races.

Root cause: The test assumed synchronous propagation of ITC (inter-thread communication) events after drop_database and csv_data_load. In reality, worker schema-reopen and auth-cache invalidation are async — the next request can arrive before all workers have settled.

Fixes (test-only, no product code changed):

  • drop_database → worker schema-reopen race: wrapped the subsequent DB operation in the existing waitFor() poll helper, retrying until the RocksDB LOCK error clears.
  • csv_data_load stall on Bun when re-introducing dropped attributes: skipped on Bun, matching the existing #1222 TODO pattern in the suite.

Verified: 6/6 local runs, 48/48 tests pass.


Generated with Claude Opus 4.8

@kriszyp kriszyp requested a review from kylebernhardy June 24, 2026 12:51
@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

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

Copy link
Copy Markdown
Contributor

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 introduces polling via waitFor in the drop_database integration test to resolve a race condition that causes lock errors. It also skips a csv_data_load test on the Bun runtime to prevent indefinite stalls. The review feedback suggests using optional chaining when inspecting the response of the polled request to prevent potential TypeErrors if the response body is undefined.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread integrationTests/apiTests/terminology.test.mjs Outdated
@kriszyp kriszyp marked this pull request as ready for review June 24, 2026 14:18
Kris Zyp and others added 2 commits June 25, 2026 18:34
…auth races

Two async-ITC-propagation races caused ~50% CI failure rate with varying line numbers:

1. drop_database races the worker schema-reopen after the table drops, occasionally
   producing a RocksDB "No locks available" LOCK error. Wrapped in the existing
   waitFor() poll helper so the test retries until the schema is fully settled.

2. csv_data_load stalls on Bun when re-introducing previously dropped attributes
   (existing #1222 TODO pattern). Skipped on Bun to match established precedent.

No product code changed. Test-only stabilization. Verified locally 6/6 runs (48/48 pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…erver errors

Addresses Gemini review: a non-JSON/empty error body would make res.body.message
throw a TypeError (masking the real error and suppressing r.text in the failure).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kriszyp kriszyp merged commit f8368e4 into main Jul 1, 2026
77 of 82 checks passed
@kriszyp kriszyp deleted the kris/flake-terminology branch July 1, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants