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

Use distinct signal to wait to cancel the submission #9326

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

GangWang01
Copy link
Member

Fixes #9298

Context

Waiting using Thread.Sleep(500) in the test is unreliable.

Changes Made

Wait until the specified log appears rather than Thread.Sleep(500).

Testing

Notes

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Looks as a good way to get rid of some of the pesky flakyness - great!

I'd love to see the test to not iterate the log events repetitively. We can use MockLogger to avoid the additional thread/task and 'wake-check-sleep' pattern here

src/Build.UnitTests/BackEnd/TaskBuilder_Tests.cs Outdated Show resolved Hide resolved
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Thank you!

@GangWang01 GangWang01 merged commit 08494c7 into dotnet:main Oct 23, 2023
8 checks passed
@GangWang01 GangWang01 deleted the flakytest9298 branch October 23, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Flaky test]: CanceledTasksDoNotLogMSB4181 unit test is unreliable
3 participants