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

[MT][browser] Http.Tests fails with Operation is not supported on this platform #91673

Closed
ilonatommy opened this issue Sep 6, 2023 · 3 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono disabled-test The test is disabled in source code against the issue
Milestone

Comments

@ilonatommy
Copy link
Member

Failing after enabling all MT library tests (#91536).

[FAIL] Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler
info: System.PlatformNotSupportedException : Operation is not supported on this platform.
info:    at System.Net.Http.BrowserHttpHandler.set_Credentials(ICredentials value)
info:    at System.Net.Http.HttpClientHandler.set_Credentials(ICredentials value)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.<>c__DisplayClass49_0.<AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler>b__0(HttpMessageHandler primaryHandler, IServiceProvider _)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass8_0.<ConfigurePrimaryHttpMessageHandler>b__1(HttpMessageHandlerBuilder b)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass17_0.<CreateHandlerEntry>g__Configure|0(HttpMessageHandlerBuilder b)
info:    at Microsoft.Extensions.Http.MetricsFactoryHttpMessageHandlerFilter.<>c__DisplayClass2_0.<Configure>b__0(HttpMessageHandlerBuilder builder)
info:    at Microsoft.Extensions.Http.LoggingHttpMessageHandlerBuilderFilter.<>c__DisplayClass6_0.<Configure>b__0(HttpMessageHandlerBuilder builder)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandlerEntry(String name)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass14_0.<.ctor>b__2()
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ViaFactory(LazyThreadSafetyMode mode)
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].CreateValue()
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Value()
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandler(String name)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateClient(String name)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.AddTransientHelper[TestTypedClient](IServiceProvider s, IHttpClientBuilder builder)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass13_0`1[[Microsoft.Extensions.Http.TestTypedClient, Microsoft.Extensions.Http.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].<AddTypedClientCore>b__0(IServiceProvider s)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass4_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[TestTypedClient](IServiceProvider provider)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler()
info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
@ilonatommy ilonatommy added arch-wasm WebAssembly architecture disabled-test The test is disabled in source code against the issue area-Build-mono area-VM-threading-mono labels Sep 6, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 6, 2023
@ghost
Copy link

ghost commented Sep 6, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Failing after enabling all MT library tests (#91536).

[FAIL] Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler
info: System.PlatformNotSupportedException : Operation is not supported on this platform.
info:    at System.Net.Http.BrowserHttpHandler.set_Credentials(ICredentials value)
info:    at System.Net.Http.HttpClientHandler.set_Credentials(ICredentials value)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.<>c__DisplayClass49_0.<AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler>b__0(HttpMessageHandler primaryHandler, IServiceProvider _)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass8_0.<ConfigurePrimaryHttpMessageHandler>b__1(HttpMessageHandlerBuilder b)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass17_0.<CreateHandlerEntry>g__Configure|0(HttpMessageHandlerBuilder b)
info:    at Microsoft.Extensions.Http.MetricsFactoryHttpMessageHandlerFilter.<>c__DisplayClass2_0.<Configure>b__0(HttpMessageHandlerBuilder builder)
info:    at Microsoft.Extensions.Http.LoggingHttpMessageHandlerBuilderFilter.<>c__DisplayClass6_0.<Configure>b__0(HttpMessageHandlerBuilder builder)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandlerEntry(String name)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass14_0.<.ctor>b__2()
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ViaFactory(LazyThreadSafetyMode mode)
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].CreateValue()
info:    at System.Lazy`1[[Microsoft.Extensions.Http.ActiveHandlerTrackingEntry, Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Value()
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandler(String name)
info:    at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateClient(String name)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.AddTransientHelper[TestTypedClient](IServiceProvider s, IHttpClientBuilder builder)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass13_0`1[[Microsoft.Extensions.Http.TestTypedClient, Microsoft.Extensions.Http.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].<AddTypedClientCore>b__0(IServiceProvider s)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass4_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
info:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[TestTypedClient](IServiceProvider provider)
info:    at Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensionsTest.AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler()
info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Author: ilonatommy
Assignees: -
Labels:

arch-wasm, disabled-test, area-Build-mono, area-VM-threading-mono

Milestone: -

@SamMonoRT SamMonoRT removed untriaged New issue has not been triaged by the area owner area-Build-mono labels Sep 13, 2023
@SamMonoRT SamMonoRT added this to the 9.0.0 milestone Sep 13, 2023
@pavelsavara
Copy link
Member

BrowserHttpHandler.set_Credentials is really not supported on a browser. This is not related to MT, probably only uncovered there.

Please add
[SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] and all tests which have this on stack trace instead of this ActiveIssue.

There are also other APIs which browser doesn't support. You can find them by searching for other
[SkipOnPlatform(TestPlatforms.Browser,

@ilonatommy
Copy link
Member Author

Please add [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] and all tests which have this on stack trace instead of this ActiveIssue.

This was done in #94204, no more active issues for this issue is left. All the other tests from Microsoft.Extensions.Http.Tests pass when run on repeat with MT.

Closing.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono disabled-test The test is disabled in source code against the issue
Projects
None yet
Development

No branches or pull requests

3 participants