Skip to content

[hotfix] Fix flaky TableChangeWatcherTest by awaiting CuratorCache init#2936

Open
platinumhamburg wants to merge 1 commit intoapache:mainfrom
platinumhamburg:fix/flaky-table-change-watcher-test
Open

[hotfix] Fix flaky TableChangeWatcherTest by awaiting CuratorCache init#2936
platinumhamburg wants to merge 1 commit intoapache:mainfrom
platinumhamburg:fix/flaky-table-change-watcher-test

Conversation

@platinumhamburg
Copy link
Contributor

TableChangeWatcherTest.testSchemaChanges intermittently fails because tables are created before CuratorCache completes its initial sync. During initial sync, NODE_CHANGED events from the tree scan can race with table creation, causing processCreateTable() to observe incomplete ZK state and silently drop the CreateTableEvent.

Add awaitInitialized() to TableChangeWatcher using CuratorCacheListener .initialized() callback, and wait for it in beforeEach before creating tables. Clear any stale events from initial sync afterward.

Purpose

Linked issue: close #2935 2935

Brief change log

Tests

API and Format

Documentation

TableChangeWatcherTest.testSchemaChanges intermittently fails because
tables are created before CuratorCache completes its initial sync.
During initial sync, NODE_CHANGED events from the tree scan can race
with table creation, causing processCreateTable() to observe incomplete
ZK state and silently drop the CreateTableEvent.

Add awaitInitialized() to TableChangeWatcher using CuratorCacheListener
.initialized() callback, and wait for it in beforeEach before creating
tables. Clear any stale events from initial sync afterward.
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 TableChangeWatcherTest.testSchemaChanges due to CuratorCache initial sync race

1 participant