CAMEL-19531: Remove unnecessary Thread.sleep calls from leveldb tests#24203
Conversation
davsclaus
left a comment
There was a problem hiding this comment.
LGTM — all six Thread.sleep() removals are safe.
Thread.sleep(3) / Thread.sleep(5) in concurrent tests (4 files): These trivial delays inside Callable tasks provide no meaningful simulation. The tests already use MockEndpoint.assertIsSatisfied() with proper timeouts.
Thread.sleep(1000) between stop/start (2 files): LevelDBFile.stop() and start() are both fully synchronous — stop() calls IOHelper.close(db) and nulls the reference, start() opens a new connection via DBFactory.open(). No async cleanup, so no delay needed.
Awaitility replacement is not necessary here since the sleeps were genuinely superfluous rather than masking race conditions.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (8 modules)
|
Motivation
Some leveldb tests contain unnecessary
Thread.sleep()calls that increase test execution time without contributing to the behavior being verified.Modifications
Thread.sleep()calls from leveldb tests.Result
The tests continue to pass while avoiding unnecessary waiting, resulting in faster and more efficient test execution.