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] Try to fix random failures on playground tests build #5271

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

radical
Copy link
Member

@radical radical commented Aug 12, 2024

Aspire.Playground.Tests build failed sometimes with errors like:

Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"

The errors are not limited to this file, but can be one from any of the
playground projects.

Given:

  1. Aspire.Playgroud.Tests references various playground AppHost projects
    directly with AdditionalProperties="SkipDashboardProjectReference=true".
  2. Aspire.sln also references these playground projects.

My thinking is that msbuild ends up treating these projects like
TestShop/CatalogModel/CatalogModel.csproj as two different project
instances:

  1. One with SkipDashboardProjectReference=true (from
    Aspire.Playground.Tests)
  2. One without that property, when building the reference directly from
    Aspire.sln.

This patch avoids that entirely by defaulting to
SkipDashboardProjectReference=true on CI, and on helix.

Microsoft Reviewers: Open in CodeFlow

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-integrations Issues pertaining to Aspire Integrations packages label Aug 12, 2024
@radical radical force-pushed the fix-playground-tests-build branch from 953068b to 3c696e6 Compare August 12, 2024 21:14
`Aspire.Playground.Tests` build failed sometimes with errors like:

`Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

The errors are not limited to this file, but can be one from any of the
playground projects.

Given:

1. `Aspire.Playgroud.Tests` references various playground AppHost projects
   directly with `AdditionalProperties="SkipDashboardProjectReference=true"`.
2. `Aspire.sln` also references these playground projects.

My thinking is that msbuild ends up treating these projects like
`TestShop/CatalogModel/CatalogModel.csproj` as two different project
instances:

1. One with `SkipDashboardProjectReference=true` (from
   `Aspire.Playground.Tests`)
2. One without that property, when building the reference directly from
   `Aspire.sln`.

This patch avoids that entirely by defaulting to
`SkipDashboardProjectReference=true` on CI, and on helix.
@radical radical force-pushed the fix-playground-tests-build branch from 3c696e6 to cf31acc Compare August 12, 2024 21:22
@radical radical marked this pull request as ready for review August 12, 2024 21:29
@radical
Copy link
Member Author

radical commented Aug 12, 2024

@rainersigwald Does my reasoning for the issue make sense?

@radical radical marked this pull request as draft August 12, 2024 21:41
@radical radical marked this pull request as ready for review August 12, 2024 23:07
radical added a commit to radical/aspire that referenced this pull request Aug 13, 2024
There are two failures hitting CI right now:

1. `Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

    - Exceptions like this when building playground apps.
    - Waiting on dotnet#5271 which might
      be a fix.

2. Individual playground tests failing
    - Waiting on dotnet#5251

This PR disable the tests completely to get the CI in a better state,
and can be re-enabled once the aforementioned issues are fixed.
radical added a commit that referenced this pull request Aug 13, 2024
* [ci] Disable failing Aspire.Playground.Tests

There are two failures hitting CI right now:

1. `Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

    - Exceptions like this when building playground apps.
    - Waiting on #5271 which might
      be a fix.

2. Individual playground tests failing
    - Waiting on #5251

This PR disable the tests completely to get the CI in a better state,
and can be re-enabled once the aforementioned issues are fixed.
…build

# Conflicts:
#	tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
@radical
Copy link
Member Author

radical commented Aug 13, 2024

Once this is merged, we can open a PR to re-enable the playground tests.

radical added a commit to radical/aspire that referenced this pull request Aug 13, 2024
.. and don't set `SkipDashboardProjectReference=true` (see
dotnet#5271).
@radical
Copy link
Member Author

radical commented Aug 13, 2024

Once this is merged, we can open a PR to re-enable the playground tests.

#5276

@radical
Copy link
Member Author

radical commented Aug 13, 2024

Ready to merge.

radical added a commit to radical/aspire that referenced this pull request Aug 13, 2024
.. and don't set `SkipDashboardProjectReference=true` (see
dotnet#5271).
@radical radical merged commit 20d00e1 into dotnet:main Aug 13, 2024
11 checks passed
@radical radical deleted the fix-playground-tests-build branch August 13, 2024 04:49
radical added a commit to radical/aspire that referenced this pull request Aug 13, 2024
commit ed4c375
Merge: e676955 20d00e1
Author: Ankit Jain <radical@gmail.com>
Date:   Tue Aug 13 00:50:09 2024 -0400

    Merge remote-tracking branch 'origin/main' into re-enable-playground-tests

commit 20d00e1
Author: Ankit Jain <radical@gmail.com>
Date:   Tue Aug 13 00:49:21 2024 -0400

    [tests] Try to fix random failures on playground tests build (dotnet#5271)

    * [tests] Try to fix random failures on playground tests build

    `Aspire.Playground.Tests` build failed sometimes with errors like:

    `Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

    The errors are not limited to this file, but can be one from any of the
    playground projects.

    Given:

    1. `Aspire.Playgroud.Tests` references various playground AppHost projects
       directly with `AdditionalProperties="SkipDashboardProjectReference=true"`.
    2. `Aspire.sln` also references these playground projects.

    My thinking is that msbuild ends up treating these projects like
    `TestShop/CatalogModel/CatalogModel.csproj` as two different project
    instances:

    1. One with `SkipDashboardProjectReference=true` (from
       `Aspire.Playground.Tests`)
    2. One without that property, when building the reference directly from
       `Aspire.sln`.

    This patch avoids that entirely by defaulting to
    `SkipDashboardProjectReference=true` on CI, and on helix.

    * Skip dashboard references

    * fix build

commit e676955
Author: Ankit Jain <radical@gmail.com>
Date:   Mon Aug 12 23:33:26 2024 -0400

    [tests] Re-enable playground tests

    .. and don't set `SkipDashboardProjectReference=true` (see
    dotnet#5271).

commit e0e23d3
Author: Ankit Jain <radical@gmail.com>
Date:   Tue Aug 13 00:21:37 2024 -0400

    [ci] Avoid duplicating trx file on helix, and copy it for playground tests also (dotnet#5253)

commit c3fbc5b
Author: Ankit Jain <radical@gmail.com>
Date:   Mon Aug 12 23:31:22 2024 -0400

    Squashed commit of the following:

    commit b24e087
    Merge: ee90475 4f1a352
    Author: Ankit Jain <radical@gmail.com>
    Date:   Mon Aug 12 23:11:22 2024 -0400

        Merge remote-tracking branch 'origin/main' into fix-playground-tests-build

        # Conflicts:
        #	tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj

    commit ee90475
    Author: Ankit Jain <radical@gmail.com>
    Date:   Mon Aug 12 18:02:05 2024 -0400

        fix build

    commit e10b215
    Author: Ankit Jain <radical@gmail.com>
    Date:   Mon Aug 12 17:45:36 2024 -0400

        Skip dashboard references

    commit cf31acc
    Author: Ankit Jain <radical@gmail.com>
    Date:   Mon Aug 12 17:02:56 2024 -0400

        [tests] Try to fix random failures on playground tests build

        `Aspire.Playground.Tests` build failed sometimes with errors like:

        `Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

        The errors are not limited to this file, but can be one from any of the
        playground projects.

        Given:

        1. `Aspire.Playgroud.Tests` references various playground AppHost projects
           directly with `AdditionalProperties="SkipDashboardProjectReference=true"`.
        2. `Aspire.sln` also references these playground projects.

        My thinking is that msbuild ends up treating these projects like
        `TestShop/CatalogModel/CatalogModel.csproj` as two different project
        instances:

        1. One with `SkipDashboardProjectReference=true` (from
           `Aspire.Playground.Tests`)
        2. One without that property, when building the reference directly from
           `Aspire.sln`.

        This patch avoids that entirely by defaulting to
        `SkipDashboardProjectReference=true` on CI, and on helix.

commit 42cc82d
Author: Sébastien Ros <sebastienros@gmail.com>
Date:   Mon Aug 12 20:24:22 2024 -0700

    Improve reliability of `AppHostTests.TestEndpointsReturnOk` (dotnet#5251)

    Use `WaitForText` since some services are really slow to start (CosmosDB emulator takes 45s locally).
    Use predicates in LoggerNotificationService since some texts are more complex than just `Contains`. For instance CosmonDBEmulator uses `Started` as the log when it's ready, but it also uses it many other times in the middle of some lines. Another example us MySql which starts the server twice (temp server).

    Disabling mongo tests - dotnet#5274

    * Improve reliability of `AppHostTests.TestEndpointsReturnOk`

    * Fix up usings

    * fix Aspire.Playground.Tests build

    * Format TestEndpoints

    * Remove unnecessary line

    * fix build

    * Improve mysql test reliability

    * Increase host startup timeout

    * Disable mongo app in playground tests - dotnet#5274

    ---------

    Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
    Co-authored-by: Ankit Jain <radical@gmail.com>

commit 990d6d0
Author: Ankit Jain <radical@gmail.com>
Date:   Mon Aug 12 23:12:54 2024 -0400

    playground.BrowserTelemetry: avoid using npm on ci/windows (dotnet#5269)

commit 4f1a352
Author: Ankit Jain <radical@gmail.com>
Date:   Mon Aug 12 22:38:17 2024 -0400

    [ci] Disable failing Aspire.Playground.Tests (dotnet#5273)

    * [ci] Disable failing Aspire.Playground.Tests

    There are two failures hitting CI right now:

    1. `Could not copy "D:\a\_work\1\s\artifacts\obj\CatalogModel\Release\net8.0\CatalogModel.dll" to "D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'D:\a\_work\1\s\artifacts\bin\CatalogModel\Release\net8.0\CatalogModel.dll' because it is being used by another process. The file is locked by: "Pdb2Pdb (1628)"`

        - Exceptions like this when building playground apps.
        - Waiting on dotnet#5271 which might
          be a fix.

    2. Individual playground tests failing
        - Waiting on dotnet#5251

    This PR disable the tests completely to get the CI in a better state,
    and can be re-enabled once the aforementioned issues are fixed.

# Conflicts:
#	tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj
radical added a commit that referenced this pull request Aug 13, 2024
.. and don't set `SkipDashboardProjectReference=true` (see
#5271).
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants