Skip to content

Add integration tests for Saga example#489

Merged
jamesnetherton merged 2 commits intoapache:camel-quarkus-mainfrom
jamesnetherton:add-saga-tests
Mar 31, 2026
Merged

Add integration tests for Saga example#489
jamesnetherton merged 2 commits intoapache:camel-quarkus-mainfrom
jamesnetherton:add-saga-tests

Conversation

@jamesnetherton
Copy link
Copy Markdown
Contributor

Taken from #486 with some minor tweaks for:

  • Rebased for CQ 3.35.0-SNAPSHOT
  • Aligned container images with the core project
  • Enabling tests to work properly on macOS
  • Speed up CI build (hopefully) and only build saga native binaries for the integration-test sub-module

});

// Give logs a moment to flush (important in native mode)
Thread.sleep(1000);
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.

Was there a particular reason that prevents using await() here too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Switched to Awaitility.await.

}

// Either outcome is valid - test passes
assertTrue(hasSuccess || hasFailure,
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.

Are we certain that if a test failure, it's due to Payment service down? I'm afraid we miss at some point that the saga flow is down. Unless you know this type of failure is definitely coming from paying system. otherwise, maybe we can add a number of retries to the unit test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's explained in the test class comment:

    /**
     * Test saga orchestration with LRA - accepts both success and compensation outcomes.
     * Payment service has 15% random failure rate, so either scenario is valid.
     */

We probably want to tweak things to make it simpler to test both scenarios.

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.

yeah it's fine for this PR. Maybe we can look at this later

@jamesnetherton jamesnetherton merged commit 5b40ede into apache:camel-quarkus-main Mar 31, 2026
14 checks passed
@jamesnetherton jamesnetherton deleted the add-saga-tests branch March 31, 2026 06:33
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.

2 participants