Skip to content

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
@ghost ghost 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 force-pushed the fix-manifest-tests branch from f92bd77 to 4d13422 Compare August 5, 2024 23:33
@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
@radical radical requested a review from mitchdenny as a code owner 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
@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