Fix subscriptions messaging and tests #845
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
When updating to the latest spring boot version our subscription tests are failing. I can reproduce this with just the jump to Spring Boot
2.2.7
.The issue is that the
StepVerifier
s do not complete the publisher so the test stays running in the background and never completes. I have re-worked how to capture the published events in the tests, as well as fixed a bug in the subscription code that was not sending theCOMPLETE
event. However this still hangs when we are trying to process multiple events.The line here, using
toMono
stop the publisher after just one event which is why it fails when attempting to check the second message. However after usingtoFlux
the test never completes. If I manually stop it the test has actually passed as all the data was present and completed, but the test is still waiting.If someone else can help investigate or knows the Reactor methods better than I do, it would be very helpful to figure what we have to do in these integration tests. The code outside integration tests looks good.
🔗 Related Issues
#835