Skip to content

CAMEL-19531: Remove unnecessary Thread.sleep calls from leveldb tests#24203

Merged
davsclaus merged 1 commit into
apache:mainfrom
anvithsg2004:CAMEL-19531-clean
Jun 24, 2026
Merged

CAMEL-19531: Remove unnecessary Thread.sleep calls from leveldb tests#24203
davsclaus merged 1 commit into
apache:mainfrom
anvithsg2004:CAMEL-19531-clean

Conversation

@anvithsg2004

Copy link
Copy Markdown
Contributor

Motivation

Some leveldb tests contain unnecessary Thread.sleep() calls that increase test execution time without contributing to the behavior being verified.

Modifications

  • Removed unnecessary Thread.sleep() calls from leveldb tests.
  • Kept the existing test assertions and behavior unchanged.

Result

The tests continue to pass while avoiding unnecessary waiting, resulting in faster and more efficient test execution.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-leveldb
All tested modules (8 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: LevelDB (deprecated)
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@davsclaus davsclaus merged commit 56058a6 into apache:main Jun 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants