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

Fix calling of ServiceListeners on error as when BaseService.isRunningOrFailed fails error is not caught #936

Conversation

michalvavrik
Copy link
Member

Summary

I am debugging failing OperatorOpenShiftInfinispanObjectsIT and I can see resources are not cleared. One way could be to use io.quarkus.test.bootstrap.ServiceListener, but it doesn't work as expected, because following exception

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 206.475 s <<< FAILURE! - in io.quarkus.ts.infinispan.client.OperatorOpenShiftInfinispanObjectsIT
[ERROR] io.quarkus.ts.infinispan.client.OperatorOpenShiftInfinispanObjectsIT  Time elapsed: 206.475 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: Resource failed to start
	at io.quarkus.test.bootstrap.BaseService.isRunningOrFailed(BaseService.java:295)
	at org.awaitility.core.CallableCondition$ConditionEvaluationWrapper.eval(CallableCondition.java:99)
	at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248)
	at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

is not caught. I expect io.quarkus.test.bootstrap.ServiceListener#onServiceError to always be called, otherwise what is the point.

Please check the relevant options

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Dependency update
  • Refactoring
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • This change requires execution against OCP (use run tests phrase in comment)

Checklist:

  • Example scenarios has been updated / added
  • Methods and classes used in PR scenarios are meaningful
  • Commits are well encapsulated and follow the best practices

@michalvavrik michalvavrik requested a review from mjurc October 25, 2023 10:57
Copy link
Member

@mjurc mjurc left a comment

Choose a reason for hiding this comment

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

Good catch

@michalvavrik michalvavrik merged commit b4302da into quarkus-qe:main Oct 25, 2023
7 checks passed
@michalvavrik michalvavrik deleted the feature/service-listener-on-error-is-not-called branch October 25, 2023 15:40
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