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

[release/8.0] [tests] Use existing container for tests executed with RemoteExecutor #3536

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 9, 2024

Backport of #3444 to release/8.0

/cc @radical

Customer Impact

No impact.

Testing

Fixes a flaky test which has been failing often.

Risk

None. Test only change.

Regression?

The tracing tests in `ConformanceTests` for some components are run with

`RemoteExecutor.Invoke(() => RunWithFixtureAsync(obj => obj.ActivitySourceTest(key: null))).Dispose()`

.. where `RunWithFixtureAsync` starts up a `testcontainer` in the remote
process, and then runs the test. But unlike other instances of the
tracing tests, here starting up the container can take ~1min causing the `RemoteExecutor`
to fail after the default 1 min timeout.

Instead pass the connection string from the fixture to the
`RemoteExecutor`, so a new container doesn't need to be spun up.

Example log from the remote execution:

```
[testcontainers.org 00:00:02.97] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:12.09] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:21.15] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:30.22] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:39.29] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:48.35] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:57.42] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:58.52] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[testcontainers.org 00:00:59.60] Execute "/opt/mssql-tools/bin/sqlcmd -Q SELECT 1;" at Docker container d69a9831c425
[xUnit.net 00:02:38.60]     Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests.ConformanceTests_TypeSpecificConfig.TracingEnablesTheRightActivitySource [FAIL]
[xUnit.net 00:02:38.60]       Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Half-way through waiting for remote process.
[xUnit.net 00:02:38.60]       Timed out at 3/27/2024 5:35:56 PM after 60000ms waiting for remote process.
[xUnit.net 00:02:38.60]         Process ID: 36471
[xUnit.net 00:02:38.60]         Handle: 5036
[xUnit.net 00:02:38.60]         Name: dotnet
[xUnit.net 00:02:38.60]         MainModule: /datadisks/disk1/work/B5B5097E/p/dotnet-cli/dotnet
[xUnit.net 00:02:38.60]         StartTime: 3/27/2024 5:34:56 PM
[xUnit.net 00:02:38.60]         TotalProcessorTime: 00:00:02.1500000
[xUnit.net 00:02:38.60]
[xUnit.net 00:02:38.60]       Stack Trace:
[xUnit.net 00:02:38.60]         /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs(225,0): at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose(Boolean disposing)
[xUnit.net 00:02:38.60]         /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs(55,0): at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose()
[xUnit.net 00:02:38.60]         /_/tests/Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests/ConformanceTests.cs(116,0): at Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests.ConformanceTests.TracingEnabl>
[xUnit.net 00:02:38.60]            at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[xUnit.net 00:02:38.60]            at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
```

Fixes #3221
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-integrations Issues pertaining to Aspire Integrations packages label Apr 9, 2024
@danmoseley danmoseley added the Servicing-approved Approved for servicing release label Apr 9, 2024
@eerhardt eerhardt merged commit dbbd7b0 into release/8.0 Apr 9, 2024
7 checks passed
@eerhardt eerhardt deleted the backport/pr-3444-to-release/8.0 branch April 9, 2024 21:44
@danmoseley danmoseley mentioned this pull request Apr 12, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 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 Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants