Skip to content

Don't check stdout for entire string contents #30023

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

Merged
merged 2 commits into from
Feb 9, 2021

Conversation

jkotalik
Copy link
Contributor

@jkotalik jkotalik commented Feb 9, 2021

Fixes #27178 (which is already closed).
Fixes #27858

My original fix didn't quite fix all flakiness. There still ends up being an issue where logs can be split due to logs from the app racing with ANCM logs. The goal of the test is to verify that some part of the log is actually logged to either the file or test sink. The other part is to verify that the event log happens with the entire message. So I changed the check to just check for a portion of the string in the log file to verify that we are actually logging to the file.

@jkotalik jkotalik requested a review from halter73 as a code owner February 9, 2021 04:01
@ghost ghost added the area-servers label Feb 9, 2021
EventLogHelpers.VerifyEventLogEvent(deploymentResult, EventLogHelpers.InProcessThreadExitStdOut(deploymentResult, "12", expectedString), Logger);
// Logs can be split due to the ANCM logging occuring at the same time as logs from the app, so check for a portion of the
// string instead of the entire string. The entire string will still be present in the event log.
var expectedLogString = new string('a', 16);
Copy link
Member

Choose a reason for hiding this comment

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

Could this have the same issue as the 30k a's, just a lot less likely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, there are only a few log messages that can be spliced in between. So there is no way to split every string to a size smaller than 16.

@jkotalik jkotalik merged commit 580153e into main Feb 9, 2021
@jkotalik jkotalik deleted the jkotalik/fixStdOutWritingTest branch February 9, 2021 17:48
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky Test: "CheckStdoutWithLargeWrites_LogFile" CheckStdoutWithLargeWrites_TestSink CheckOversizedStdErrWrites
4 participants