Backport PR #13002 to 7.x: ispec: fix cross-spec leak from fatal error integration specs#13013
Merged
Backport PR #13002 to 7.x: ispec: fix cross-spec leak from fatal error integration specs#13013
Conversation
Because the "Fatal Error" specs specifically inject fatal errors during execution, and do so by reacting to a "poison" event, the fatal error prevents the poison event from being ACK'd in the underlying queue. By specifying a one-off temporary data directory in these specs and cleaning up after ourselves, we ensure that a PQ containing un-ACK'd events isn't leaked to the next spec to run. (cherry picked from commit 6032e5f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport PR #13002 to 7.x branch. Original message:
Release notes
[rn:skip]
What does this PR do?
FIxes cross-spec leak from "fatal error" integration specs
Because the "Fatal Error" specs specifically inject fatal errors during
execution, and do so by reacting to a "poison" event, the fatal error prevents
the poison event from being ACK'd in the underlying queue.
By specifying a one-off temporary data directory in these specs and cleaning up
after ourselves, we ensure that a PQ containing un-ACK'd events isn't leaked to
the next spec to run.
Why is it important/What is the impact to the user?
Resolves random flaky tests that were caused by being executed immediately after one of the "fatal error" tests.
In the following specific test run, the
Test Logstash configuration expands environment variables in all plugin blocksspec immediately followed one of the "fatal error" specs, which had left a "poison" event containing the message"a fatal error". Since only the "fatal error" spec knew how to convert this message into an actual fatal error, the event was processed "normally". Unfortunately, the spec being executed didn't expect it to be there and its assertions failed.Depending on what the next test to run validated, this "leak" may or may not end up breaking one of its unrelated assertions.
Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs