Skip to content

Fix flaky L1 priority queue blocking test - #18364

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/l1-priority-queue-test-wait
Open

Fix flaky L1 priority queue blocking test#18364
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/l1-priority-queue-test-wait

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Fix a timing race in L1PriorityQueueTest.testPollBlocked observed in an unrelated Windows unit-test job.

The test slept for a fixed 100 ms before checking the worker thread state. On a loaded runner, the worker could still be RUNNABLE, even though L1PriorityQueue.poll() blocks correctly once it reaches the empty queue.

Use Awaitility with a bounded timeout for both the WAITING and TERMINATED states. This matches the existing synchronization pattern in L2PriorityQueueTest and MultilevelPriorityQueueTest.

Tests

  • mvn '-Ddevelocity.off=true' -pl iotdb-core/datanode -am '-Dtest=L1PriorityQueueTest' '-Dsurefire.failIfNoSpecifiedTests=false' test
    • Tests run: 5, failures: 0, errors: 0

This PR has:

  • been self-reviewed.
  • replaced fixed sleeps with bounded condition waits.
  • reused the established pattern from sibling queue tests.
  • passed the targeted DataNode unit test locally.

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.

1 participant