Skip to content

issue #608: stabilise SegmentOwnershipTransferTest waitFor deadline#622

Merged
eolivelli merged 2 commits into
masterfrom
issue-608-flaky-test-herddb-indexing-segment-segme
May 20, 2026
Merged

issue #608: stabilise SegmentOwnershipTransferTest waitFor deadline#622
eolivelli merged 2 commits into
masterfrom
issue-608-flaky-test-herddb-indexing-segment-segme

Conversation

@eolivelli
Copy link
Copy Markdown
Owner

Fixes #608.

Changes

  • herddb-indexing-service/src/test/java/herddb/indexing/segment/SegmentOwnershipTransferTest.java — raise the deadline in the file-local waitFor helper from 10 s → 30 s and add a String desc parameter so a timeout failure identifies the exact predicate. The 10 s budget proved too tight on contended CI runners (observed in run 25856862885, PR issue #544: replace Maven Checkstyle with Spotless #554) where the watcher's single-thread dispatch executor has to process several ZK watcher fires plus an index re-list per transition. 30 s matches the deadline used by comparable polling helpers elsewhere in the suite (OptimizerMergeAdoptionRecallTest, IndexOptimizerSessionExpiredTest, OptimizerTaskRegistryIntegrationTest). Healthy runs still complete each cycle in well under a second.
  • CLAUDE.md (small unrelated doc fix surfaced while running pre-PR validation) — warn that mvn checkstyle:check must not be invoked directly (it falls back to Sun defaults and reports thousands of bogus violations since Spotless replaced Checkstyle in Move from checkstyle to spotless #544/issue #544: replace Maven Checkstyle with Spotless #554), and reorder the pre-PR command so spotbugs:check runs after install, matching .github/workflows/ci.yml.

Tests

  • All 7 tests in SegmentOwnershipTransferTest pass locally with the new helper.
  • repeatedTransfersFireTerminalEventsExactlyOncePerCycle run 3× in isolation: 3 / 3 green, ~0.83 s each.
  • Pre-PR validation (mvn -B spotless:check apache-rat:check install -DskipTests spotbugs:check -Pci) green across all modules.

This change does not touch any production code path — it only relaxes a brittle test timing budget and improves the failure message — so no new test was added (a "should not flake" test on a healthy local box would always pass and provide no signal).

🤖 Implemented by the `pr-worker` agent.

eolivelli added 2 commits May 20, 2026 19:18
Bump the per-cycle deadline in the file-local waitFor helper from 10s to
30s and thread a String desc through so a timeout failure pinpoints
which predicate did not stabilise. The 10s budget proved too tight on
contended CI runners (observed in run 25856862885 on PR #554) — the
SegmentAssignmentWatcher's single-thread dispatch executor must process
several ZK watcher fires plus an index re-list per transition, and 30s
matches the deadline used by comparable polling helpers elsewhere in
the indexing-service test suite (OptimizerMergeAdoptionRecallTest,
IndexOptimizerSessionExpiredTest, OptimizerTaskRegistryIntegrationTest).
Healthy local runs still complete in under a second per cycle.
- Call out that mvn checkstyle:check must NOT be invoked directly: with
  no project-level config the plugin falls back to Sun defaults and
  prints thousands of bogus violations (Spotless replaced Checkstyle in
  issue #544 / PR #554).
- Reorder the pre-PR validation command so spotbugs:check runs after
  install, matching .github/workflows/ci.yml. spotbugs analyses the
  freshly-compiled .class files install writes; the previous ordering
  could leave it inspecting stale (or no) classes.
@eolivelli eolivelli merged commit 3a48bba into master May 20, 2026
14 of 15 checks passed
@eolivelli eolivelli deleted the issue-608-flaky-test-herddb-indexing-segment-segme branch May 20, 2026 18:20
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.

Flaky test: herddb.indexing.segment.SegmentOwnershipTransferTest

1 participant