Skip to content

validator: fix flaky routing tests racing the BOOTSTRAPPING state - #555

Merged
swasik merged 3 commits into
scylladb:masterfrom
QuerthDP:fix-flaky-routing-tests
Aug 14, 2026
Merged

validator: fix flaky routing tests racing the BOOTSTRAPPING state#555
swasik merged 3 commits into
scylladb:masterfrom
QuerthDP:fix-flaky-routing-tests

Conversation

@QuerthDP

@QuerthDP QuerthDP commented Aug 13, 2026

Copy link
Copy Markdown
Member

The validator routing tests has been failing on master as well as unrelated branches.

The index status reported over the HTTP API is a snapshot the engine refreshes once per second. The routing tests index a single-row table, so the whole BOOTSTRAPPING phase lasted ~0.65s and could fall between two refreshes, leaving the index to go from INITIALIZING straight to SERVING. The tests then timed out waiting for a state that was never reported. A panicking test also left its keyspace behind, so later tests waiting for an empty index listing failed too, which is why one flake showed up as several.

Changes:

  • Wait for the specific index to disappear rather than for the whole listing to drain, so a failure stays attributed to the test that caused it.
  • Give proxy-based groups a 100ms status refresh interval and raise the routing frame delay to 500ms, putting the bootstrapping phase an order of magnitude above the refresh interval.
  • Reset the proxy rules when a test opens its connections. Rules belong to the group's proxy and the fixture is set up once, so a test that panics with rules active slows down every test after it.

The recurring no SELECT permission CDC warnings are unrelated. Dropping an index revokes the SELECT that VECTOR_SEARCH_INDEXING grants implicitly, before the readers shut down. They are emitted by scylla-cdc, one per stream reader, and appear in passing runs too.

Fixes: VECTOR-852
Fixes: VECTOR-679
Refs: VECTOR-680

Several tests waited for the whole index listing of a node to become
empty (or to shrink to a fixed length) after dropping an index.
That assertion is not scoped to the test that makes it: a group runs
against one shared cluster, and a test that panics before its
`DROP KEYSPACE` leaves its indexes behind.
Every later test in the group that waits for an empty listing
then times out as well, so a single failure is reported as several
and the one that actually broke is buried among the follow-up failures.

Use the existing `wait_for_no_index()` helper, which waits for one
specific index to disappear, in all of those places. Failures now stay
attributed to the test that caused them.
The routing tests need an index to sit in the BOOTSTRAPPING state long
enough to be observed and queried, and they were losing that race in CI.
The wait for the state timed out after 60s even though the index had been
built long before.

Two things have to hold for the state to be observable, and neither did.

The status a node reports for an index over the HTTP API is a snapshot
that the engine refreshes on a timer, once per second by default,
so a state shorter than that interval can pass between two refreshes and
never be reported at all. Give the nodes of proxy-based groups a 100ms
refresh interval, so the snapshot tracks the internal state closely
enough to be sampled. Groups that do not manipulate the timing keep the
production default, so it stays covered.

The tables in these tests hold a single row, so the initial full scan
costs only a handful of round trips and finishes in well under a second.
The tests already delayed the traffic between the Vector Store and the
DB to stretch that phase, but 100ms per frame stretched it to ~0.65s,
below the refresh interval. Raise it to 500ms, which puts the phase an
order of magnitude above the refresh interval.
The scylla-proxy request rules belong to the group's proxy actor,
and the group fixture is set up once for the whole group, so nothing resets
them between tests. A test that panics between enabling the rules and turning
them off therefore leaves them in place for every test that runs after
it, including tests that never touch the proxy at all. The follow-up
tests then time out waiting for an index to be created or to reach
SERVING, which reads as an unrelated failure.

Turn the rules off in the no-TLS connection helper, which every
proxy-based test calls before it installs any rule of its own,
so each test starts from a known state. The call is a no-op for groups
running without a proxy.
@QuerthDP QuerthDP changed the title validator: fix flaky routing tests validator: fix flaky routing tests racing the BOOTSTRAPPING state Aug 13, 2026
@QuerthDP
QuerthDP marked this pull request as ready for review August 13, 2026 15:11
@QuerthDP
QuerthDP requested review from ewienik and swasik August 13, 2026 15:11
@QuerthDP
QuerthDP requested a balanced review from Copilot August 13, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stabilizes validator routing tests by making index deletion checks specific and proxy timing deterministic.

Changes:

  • Wait for targeted indexes to disappear.
  • Increase routing delays and shorten proxy index-status refreshes.
  • Reset stale proxy rules when opening test connections.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/validator/src/routing.rs Stabilizes BOOTSTRAPPING-state tests.
crates/validator/src/full_scan.rs Uses targeted index-removal waits.
crates/validator/src/crud.rs Uses targeted index-removal waits.
crates/validator/src/common.rs Configures refresh timing and resets proxy rules.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@swasik
swasik added this pull request to the merge queue Aug 14, 2026
Merged via the queue into scylladb:master with commit 5347f2a Aug 14, 2026
87 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants