Skip to content

Fixing the Flaky Test for org.apache.fluss.client.table.scanner.batch.KvSnapshotBatchScannerITCase.testKvSnapshotLease#2808

Open
hemanthsavasere wants to merge 2 commits intoapache:mainfrom
hemanthsavasere:2807-fix-Flaky-test-KvSnapshotBatchScannerITCase.testKvSnapshotLease
Open

Fixing the Flaky Test for org.apache.fluss.client.table.scanner.batch.KvSnapshotBatchScannerITCase.testKvSnapshotLease#2808
hemanthsavasere wants to merge 2 commits intoapache:mainfrom
hemanthsavasere:2807-fix-Flaky-test-KvSnapshotBatchScannerITCase.testKvSnapshotLease

Conversation

@hemanthsavasere
Copy link
Contributor

@hemanthsavasere hemanthsavasere commented Mar 6, 2026

Purpose

  • Fix a race condition in FlussClusterExtension.triggerSnapshot() that caused testKvSnapshotLease to intermittently fail with expected: [1L, 1L, 1L] but was: [1L, 0L, 1L].

Linked issue: close #2807

Brief change log

File: fluss-server/src/test/java/org/apache/fluss/server/testutils/FlussClusterExtension.java

  • Before: Read currentSnapshotId() synchronously right after triggerSnapshot(); if unchanged, returned null and skipped the bucket
  • After: Poll currentSnapshotId() in a loop (10ms sleep, 30s timeout) until the ID increments, confirming the async trigger was actually processed; fail with a clear message on timeout

Tests

  • Test: fluss-client/src/test/java/org/apache/fluss/client/table/scanner/batch/KvSnapshotBatchScannerITCase.java
  • Fix target: fluss-server/src/test/java/org/apache/fluss/server/testutils/FlussClusterExtension.java:747-775

API and Format

  • No API changes. Changes only related to tests.

Documentation

  • No new features are introduced

….KvSnapshotBatchScannerITCase.testKvSnapshotLeas
….KvSnapshotBatchScannerITCase.testKvSnapshotLease timeout fix
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: KvSnapshotBatchScannerITCase.testKvSnapshotLease

1 participant