Skip to content

Make the Guardiann test helpers reusable as test fixtures - #4677

Draft
normen662 wants to merge 1 commit into
apple/normen662/guardiann-test-fixtures/1-publish-fixturesfrom
apple/normen662/guardiann-test-fixtures/2-guardiann-fixtures
Draft

normen662 wants to merge 1 commit into
apple/normen662/guardiann-test-fixtures/1-publish-fixturesfrom
apple/normen662/guardiann-test-fixtures/2-guardiann-fixtures

Conversation

@normen662

@normen662 normen662 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Moves the reusable Guardiann test code into the fdb-extensions test fixtures, so that it is published with them (see #4676) and can be reused outside this build. Existing tests use the moved code; their behavior is unchanged.

  • guardiann/TestHelpers becomes the public GuardiannTestHelpers fixture (batch insert/delete, sampling, recall and ordered-by-distance checks, the test listeners). countUnderReplicatedPrimaries moves into its only user, ReassignConvergenceTest.
  • ConfigRecommendation moves into the fixtures and becomes public.
  • Minimal generalizations: the dynamic recall check takes the metric of its brute-force ground truth (existing callers pass EUCLIDEAN_SQUARE_METRIC, which computes exactly the previous l2SquaredDistance), and the recall checks accept any searcher (BiFunction<RealVector, Integer, List<Tuple>>); the Guardiann overloads delegate to them.
  • The reusable parts of SiftTest become static helpers: interleavedChurnSchedule and shuffledDeleteBatches (the insert/delete schedules, with the same use of the random generator as before), and the assertOnlyPrimaryKeysRemain, assertDrainedToSingleEmptyCluster and describeStructure structure checks in GuardiannStructureAsserts. SiftTest keeps its tests and loops, which now use them.

Verified: :fdb-extensions:check passes (including scalarFallbackTest); the recall, quality and checkpoint log lines of all six SiftTest tests (CI and -Ptests.nightly variants) are byte-identical to main for the same seed.

Move the Guardiann test helpers (`TestHelpers`, now `GuardiannTestHelpers`) and `ConfigRecommendation` into the
fdb-extensions test fixtures, and lift the reusable parts of `SiftTest` into static helpers there: the interleaved
churn and shuffled delete schedules, and the "only these primary keys remain" and "drained to a single empty cluster"
structure checks. The dynamic recall check takes the metric of its brute-force ground truth, and the recall checks
accept any searcher. `SiftTest` keeps its tests and loops, which now use these helpers; its behavior is unchanged.
@normen662
normen662 added this pull request to stack #4679 September 27, 2026 10:47
@normen662 normen662 added the testing improvement Change that improves our testing label Sep 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing improvement Change that improves our testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant