DistributedApplicationTests improvements#7325
Merged
Conversation
JamesNK
reviewed
Jan 30, 2025
ReubenBond
approved these changes
Jan 30, 2025
3 tasks
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
davidfowl
reviewed
Jan 30, 2025
Contributor
|
Looks like a real test failure |
3184722 to
8f2b438
Compare
Contributor
Author
|
@davidfowl the failing Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable does not seem to be related to this change on cursory glance. Relevant log fragment [xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] fail: Microsoft.Extensions.Hosting.Internal.Host[11]
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] Hosting failed to start
[first-run] fail: Microsoft.Extensions.Hosting.Internal.Host[11]
[first-run] Hosting failed to start
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] Microsoft.Extensions.Options.OptionsValidationException: The 'applicationUrl' setting must be an https address unless the 'ASPIRE_ALLOW_UNSECURED_TRANSPORT' environment variable is set to true. This configuration is commonly set in the launch profile. See https://aka.ms/dotnet/aspire/allowunsecuredtransport for more details.
[first-run] Microsoft.Extensions.Options.OptionsValidationException: The 'applicationUrl' setting must be an https address unless the 'ASPIRE_ALLOW_UNSECURED_TRANSPORT' environment variable is set to true. This configuration is commonly set in the launch profile. See https://aka.ms/dotnet/aspire/allowunsecuredtransport for more details.
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
[first-run] at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
[first-run] at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
[first-run] at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at System.Lazy`1.CreateValue()
[first-run] at System.Lazy`1.CreateValue()
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd[TArg](String name, Func`3 createOptions, TArg factoryArgument)
[first-run] at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd[TArg](String name, Func`3 createOptions, TArg factoryArgument)
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Options.OptionsMonitor`1.Get(String name)
[first-run] at Microsoft.Extensions.Options.OptionsMonitor`1.Get(String name)
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.DependencyInjection.OptionsBuilderExtensions.<>c__DisplayClass0_1`1.<ValidateOnStart>b__1()
[first-run] at Microsoft.Extensions.DependencyInjection.OptionsBuilderExtensions.<>c__DisplayClass0_1`1.<ValidateOnStart>b__1()
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Options.StartupValidator.Validate()
[first-run] at Microsoft.Extensions.Options.StartupValidator.Validate()
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] --- End of stack trace from previous location ---
[first-run] --- End of stack trace from previous location ---
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Options.StartupValidator.Validate()
[first-run] at Microsoft.Extensions.Options.StartupValidator.Validate()
[xUnit.net 00:06:47.94] Aspire.Workload.Tests.BuildAndRunTemplateTests.ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable [OUTPUT] [first-run] at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken I have asked @joperezr to take a peek too (TIA!) Other than that no test failures. Optimistically merge? EDIT: this PR caused the test failure, but it had nothing to do with the error above |
Contributor
Author
|
Still working with @joperezr to see if this change made a difference |
Contributor
Author
|
Turns out it was indeed my change that caused the test to fail. Fix available. |
a139781 to
313d250
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change does 3 things
DcpExecutor.RunApplicationAsync()throws (which makes someDistributedApplicationExecutortests hang).DistributedApplicationExecutortests use unique names for resources they create (in particular, Containers). This should help diagnose any leaking resources.DistributedApplicationis disposed. This means only executing tests have DCP instances running, and as soon as a test completes, the associated DCP instance goes through the shutdown. This in turn minimizes resource consumption on the machine, in particular there will be less Docker containers/networks at any given time.