Skip to content

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

Merged
rmarinho merged 4 commits into
dotnet:mainfrom
MartyIX:dev/async-await-2
Apr 9, 2024
Merged

Make sure to await async test asserts (2)#20506
rmarinho merged 4 commits into
dotnet:mainfrom
MartyIX:dev/async-await-2

Conversation

@MartyIX

@MartyIX MartyIX commented Feb 11, 2024

Copy link
Copy Markdown
Contributor

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 PureWeen and rmarinho February 11, 2024 15:55
@ghost ghost added the community ✨ Community Contribution label Feb 11, 2024
@ghost

ghost commented Feb 11, 2024

Copy link
Copy Markdown

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
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
Copy Markdown
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

jsuarezruiz commented Feb 12, 2024

Copy link
Copy Markdown
Contributor

/azp run

@jsuarezruiz jsuarezruiz added the area-testing Unit tests, device tests label Feb 12, 2024
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX

MartyIX commented Feb 27, 2024

Copy link
Copy Markdown
Contributor Author

@jsuarezruiz What is the next step please?

@MartyIX

MartyIX commented Mar 11, 2024

Copy link
Copy Markdown
Contributor Author

@mattleibow friendly ping

@MartyIX

MartyIX commented Mar 19, 2024

Copy link
Copy Markdown
Contributor Author

@jsuarezruiz Ping please

@azure-pipelines

Copy link
Copy Markdown
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
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho left a comment

Copy link
Copy Markdown
Member

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

MartyIX commented Mar 20, 2024

Copy link
Copy Markdown
Contributor Author

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

MartyIX commented Mar 26, 2024

Copy link
Copy Markdown
Contributor Author

@rmarinho Could you please re-run?

@MartyIX

MartyIX commented Apr 2, 2024

Copy link
Copy Markdown
Contributor Author

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

@rmarinho

rmarinho commented Apr 2, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX

MartyIX commented Apr 9, 2024

Copy link
Copy Markdown
Contributor Author

@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
@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