-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add helper method to wait for log message to be observed #17589
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
Conversation
There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured.
This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
|
While debugging this I was printing the logs:
As you can see there are some rogue byte sequences in there, but they appear to only be on line endings so they are probably not breaking up the string we are looking for. I looked a bit in to upserve/docker-api#290 and it seems like maybe we could switch methods if we are still having issues. |
Working locally:
|
Kicked off exhaustive test pipeline on this branch: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/1780 |
Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method.
|
💚 Build Succeeded
History
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your time to keep CI healthy
@Mergifyio backport 8.17 8.18 8.19 9.0 |
✅ Backports have been created
|
* Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd)
* Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd)
* Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd)
* Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd)
…7605) * Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd) Co-authored-by: Cas Donoghue <[email protected]>
…7606) * Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd) Co-authored-by: Cas Donoghue <[email protected]>
…7607) * Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd) Co-authored-by: Cas Donoghue <[email protected]>
…7608) * Add helper method to wait for log message to be observed There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured. * Use local scop container ref Due to a copy paste error, the wrong reference to container (instance var) was being used. When test file that did not define this uses the helper it failed. The helper should use the ref explicitly passed to the method. (cherry picked from commit c31fcfd) Co-authored-by: Cas Donoghue <[email protected]>
Release notes
[rn:skip]
What does this PR do?
There appears to be a race condition in tests whereby log messages are not observed with a single interogation of the container logs. This commit adds a helper method to wait for log messages. This should make the tests more resilient when there is a delay in log messages being captured.
Why is it important/What is the impact to the user?
NA
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Logs
Example failure:
https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/1776#_