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

Npgsql: Fix test cases to use async, stop relevant warnings #771

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

amotl
Copy link
Member

@amotl amotl commented Dec 11, 2024

Problem

The test suite started emitting such warnings the other day:

Test methods should not use blocking task operations, as they can cause deadlocks.
Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

-- https://github.com/crate/cratedb-examples/actions/runs/12248712216

Solution

The patch has been created by making the flagged methods and their ingredients async, following corresponding advises by the .NET runtime, and then following relevant suggestions from the PyCharm IDE.

@amotl amotl force-pushed the npgsql-maintenance-2014-12 branch from e6267f4 to 422f050 Compare December 11, 2024 10:27
@amotl amotl requested review from kneth and surister December 11, 2024 10:30
@amotl amotl marked this pull request as ready for review December 11, 2024 10:30
@amotl amotl force-pushed the npgsql-maintenance-2014-12 branch 3 times, most recently from 4241851 to fd4d46f Compare December 11, 2024 23:52
@amotl amotl force-pushed the npgsql-maintenance-2014-12 branch from bd58391 to b9b9a8d Compare December 12, 2024 00:07
Copy link

@kneth kneth left a comment

Choose a reason for hiding this comment

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

LGTM

It looks like xUnit1031 was introduced long time ago so it is surprising that it didn't surface until the Ubuntu GHA runner was changed.

@amotl
Copy link
Member Author

amotl commented Dec 13, 2024

It looks like xUnit1031 was introduced long time ago so it is surprising that it didn't surface until the Ubuntu GHA runner was changed.

CI was accompanied by relevant warnings for a long time already. The changes about async are not related to the runner change here. The runner downgrade b62907a has been conducted in order to keep supporting .NET 7 on CI, FWIW. It doesn't hurt right now, but I guess we may phase it out while we go, as soon as it creates problems?

@amotl amotl merged commit 706a09d into main Dec 13, 2024
9 checks passed
@amotl amotl deleted the npgsql-maintenance-2014-12 branch December 13, 2024 15:53
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.

2 participants