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

[tests] Fix some flaky tests in Aspire.Hosting.Azure.Tests #5187

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

radical
Copy link
Member

@radical radical commented Aug 5, 2024

Some tests generate .module.bicep files in the tests' bindir. Some such tests running in parallel can interfere with others getting the incorrect content.

  • For example, one test writes postgres.module.bicep, and before it can read it back, it gets overwritten by a different test with slightly different contents, thus breaking the first test.
  • this can also result in errors like System.IO.IOException: The process cannot access the file '/mnt/vss/_work/1/s/artifacts/bin/Aspire.Hosting.Azure.Tests/Release/net8.0/postgres.module.bicep' because it is being used by another process.

Fixes: #5174
Fixes: #5113

Microsoft Reviewers: Open in CodeFlow

…ng the manifest

Other tests also generate and use `postgres.module.bicep` in the tests'
bindir, and these can run in parallel causing them to interfere with
each other.

Issue: dotnet#5174
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-integrations Issues pertaining to Aspire Integrations packages label Aug 5, 2024
Avoid interfering with other tests by generating the bicep files in
per-test temporyary paths.

`AzureBicepResourceTests.AsAzurePostgresFlexibleServerViaRunMode`
uses `postgres.module.bicep` also, and that file can get overwritten by
other tests like in `AzureBicepResourceTests`.

Issue: dotnet#5113
@radical radical added area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication and removed area-integrations Issues pertaining to Aspire Integrations packages labels Aug 5, 2024
@radical radical marked this pull request as ready for review August 5, 2024 23:54
Copy link
Member

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

@eerhardt eerhardt merged commit cd1a61e into dotnet:main Aug 6, 2024
11 checks passed
@mitchdenny
Copy link
Member

I was literally looking at this same problem yesterday! Thanks for the fix!

@radical radical deleted the fix-manifest-tests branch August 6, 2024 04:56
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
4 participants