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

Make sure to await async test asserts (2) #20506

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

MartyIX
Copy link
Contributor

@MartyIX MartyIX commented Feb 11, 2024

Description of Change

Await the async methods.

This PR just adds one commit to #19994 as CS4014 warnings are reported in my MSVS 17.9 P5 now:

image

cc @mattleibow

@MartyIX MartyIX requested a review from a team as a code owner February 11, 2024 15:55
@MartyIX MartyIX requested review from rmarinho and PureWeen February 11, 2024 15:55
@ghost ghost added the community ✨ Community Contribution label Feb 11, 2024
@ghost
Copy link

ghost commented Feb 11, 2024

Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@MartyIX MartyIX changed the title Dev/async await 2 Make sure to await async test asserts (2) Feb 11, 2024
@@ -63,9 +63,9 @@ public static async Task Run(Func<Task> asyncMethod)
// Invoke the function and alert the context when it's complete
var task = asyncMethod() ?? throw new InvalidOperationException("No task provided.");

task.ContinueWith(async (t, o) => await context.Complete(), TaskScheduler.Default);
_ = task.ContinueWith(async (t, o) => await context.Complete(), TaskScheduler.Default);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this one.

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Feb 12, 2024

/azp run

@jsuarezruiz jsuarezruiz added the area-testing Unit tests, device tests label Feb 12, 2024
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX
Copy link
Contributor Author

MartyIX commented Feb 27, 2024

@jsuarezruiz What is the next step please?

@MartyIX
Copy link
Contributor Author

MartyIX commented Mar 11, 2024

@mattleibow friendly ping

@MartyIX
Copy link
Contributor Author

MartyIX commented Mar 19, 2024

@jsuarezruiz Ping please

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX MartyIX force-pushed the dev/async-await-2 branch from ad7192d to 6c9f9c0 Compare March 19, 2024 11:07
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Seems we still have a couple more..

D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\DeviceUnitTests.cs(92,67): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\Controls.Core.UnitTests.csproj]
D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\DeviceUnitTests.cs(131,69): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\Controls.Core.UnitTests.csproj]
    5928 Warning(s)
    2 Error(s)

@MartyIX MartyIX force-pushed the dev/async-await-2 branch from 6c9f9c0 to c7a94cf Compare March 20, 2024 11:31
@MartyIX
Copy link
Contributor Author

MartyIX commented Mar 20, 2024

Seems we still have a couple more..

D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\DeviceUnitTests.cs(92,67): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\Controls.Core.UnitTests.csproj]
D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\DeviceUnitTests.cs(131,69): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Controls\tests\Core.UnitTests\Controls.Core.UnitTests.csproj]
    5928 Warning(s)
    2 Error(s)

I have modified it.

@MartyIX
Copy link
Contributor Author

MartyIX commented Mar 26, 2024

@rmarinho Could you please re-run?

@MartyIX
Copy link
Contributor Author

MartyIX commented Apr 2, 2024

@rmarinho Could you please re-run, or is there an issue?

@rmarinho
Copy link
Member

rmarinho commented Apr 2, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX
Copy link
Contributor Author

MartyIX commented Apr 9, 2024

@rmarinho It looks like it succeeded..?

@rmarinho rmarinho enabled auto-merge (squash) April 9, 2024 11:16
@rmarinho rmarinho disabled auto-merge April 9, 2024 15:27
@rmarinho rmarinho merged commit 8410edb into dotnet:main Apr 9, 2024
45 of 47 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2024
@MartyIX MartyIX deleted the dev/async-await-2 branch May 15, 2024 06:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants