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 Test Watcher Timeouts and Log Checker File Reading Issues #83427

Merged
merged 2 commits into from
Mar 15, 2023
Merged

Fix Test Watcher Timeouts and Log Checker File Reading Issues #83427

merged 2 commits into from
Mar 15, 2023

Conversation

ivdiazsa
Copy link
Member

Addresses #83298.

@ghost
Copy link

ghost commented Mar 14, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

Addresses #83298.

Author: ivdiazsa
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@ivdiazsa
Copy link
Member Author

ivdiazsa commented Mar 14, 2023

Please review carefully as soon as possible to fix the outer loop problems.
@hoyosjs @trylek @BruceForstall @jkoritzinsky

@ivdiazsa
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +96 to +101
if (!File.Exists(statsCsvPath))
{
Console.WriteLine("[XUnitLogChecker]: An error occurred. No stats csv"
+ $" was found. The expected name would be '{statsCsvPath}'.");
return FAILURE;
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to cause a problem for the work items that are completely filtered out (test run effectively skipped) in some of the outerloop runs? I know we just had to fix that earlier, so I want to make sure we don't break that scenario again.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's addressed in the first check, on line 69. For those skipped items, we don't have a temp log either. So the first check catches that and exits gracefully.

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

This LGTM.

However, the revert PR #83412 is ready. It might be timely to merge that and submit this "real" fix with less time pressure. I'll let you and @hoyosjs decide.

IEnumerable<string>? fileContents = null;
Stopwatch fileReadStopwatch = Stopwatch.StartNew();

while (fileReadStopwatch.Elapsed.Seconds < 60)
Copy link
Member

Choose a reason for hiding this comment

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

Nit - while mostly functional in practice, technically this is incorrect as the Elapsed property returns a TimeSpan representing the elapsed time and only checking its Seconds field would for instance yield zero at a one minute mark, I believe this is the purpose of the ElapsedTicks and ElapsedMilliseconds properties on Stopwatch.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, in fact, upon second reading I think it's completely incorrect as the Seconds property is always in the range 0-59 so this is basically an infinite loop in case the file remains locked forever.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@ivdiazsa
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Ivan!

@JulieLeeMSFT
Copy link
Member

Thanks @ivdiazsa for the fix.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 14, 2023
@ivdiazsa ivdiazsa deleted the fixing-watcher-ci-again branch April 24, 2023 22:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants