Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish integration tests #4741

Conversation

hpoettker
Copy link
Contributor

Due to FaultTolerantStepFactoryBeanRollbackIntegrationTests, the build pipeline has been intermittently stalling recently. The similar test FaultTolerantStepFactoryBeanIntegrationTests was disabled in 3758f86b for the same behavior.

So far, I couldn't reproduce the problem locally. But the PR offers some minor improvements.

In the Mongo integration tests, the application context and in particular the Mongo client are now closed after each test, respectively. This prevents the Mongo clients from closing on a failed health check during later tests, which is harmless but produces noisy logging during those tests.

I don't have a good hypothesis why the fault-tolerance tests are stalling intermittently. So I don't know whether this PR will resolve the issue. But it implements some concurrency best practices:

  • the readers have been replaced by the battle tested ListItemReader wrapped in a SynchronizedItemReader.
  • unused fields in the processors and writers have been removed
  • fields in the processors and writers are now either constant or thread-safe collections
  • fields in the processors and writers are now final and set in the constructor

Furthermore, the tests now have a time-out of 30 seconds such that they are cleanly aborted if they should still stall.

In the Mongo integration tests, the application context and in particular the Mongo client are now closed after each test, respectively.

Thread-safety of the fault-tolerance integration steps is improved as they are intermittingly stalling.
@fmbenhassine
Copy link
Contributor

That's great! Thank you for all these improvements 👍

Rebased and merged as bbd46fb.

@fmbenhassine fmbenhassine added this to the 5.2.2 milestone Feb 20, 2025
@hpoettker hpoettker deleted the close-mongo-resources-after-integ-tests branch February 20, 2025 12:06
@hpoettker
Copy link
Contributor Author

hpoettker commented Feb 20, 2025

The test still fails. 😞
But at least it doesn't take 6 hours to do so. 😄

It's probably easiest to disable the two tests until we have an idea what the root cause is.

@fmbenhassine
Copy link
Contributor

Yes I just saw the build failure and tried to re-run it.

I remember I was never able to reproduce it locally and was failing on Github Actions, that's why I disabled it at the time.

OK no problem I will disable them again.

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