pulsar
pulsar copied to clipboard
[fix][test]fix flaky test deleteNamespaceGracefully
Fixes #18232
Motivation
https://github.com/poorbarcode/pulsar/actions/runs/3267034877/jobs/5371836130 https://github.com/apache/pulsar/actions/runs/3242148385/jobs/5326408439
The original implementation determines whether to wait for the creation of __chang_event based on whether a broker has taken ownership of the bundle or not. However, there are often 'set namespace policy', 'unload namespace', 'delete namespace', 'split bundle', and other operations in the test case. When the bundle unload and the 'bundle checkconcurrently execute, the methoddeleteNamespaceGraceFully` will run unstably.
Modifications
- Instead of relying on 'bundle owned' to determine whether to wait for the creation of topic
__change_event, change to track the creation of all system topic clients (readers & writers) and wait for all clients(readers & writers) to be created finished before deleting the namespace - Originally,
deleteNamespaceGraceFullyin classBrokerTestBase, and thenMockedPulsarServiceBaseTestcalledBrokerTestBase.deleteNamespaceGraceFully(). ButMockedPulsarServiceBaseTestis the super class ofBrokerTestBase, so move methoddeleteNamespaceGraceFullytoMockedPulsarServiceBaseTest.
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository:
- https://github.com/poorbarcode/pulsar/pull/31