-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Test Failure: UseStartupFactoryWorks #30582
Comments
Thanks for contacting us. |
The test that's been quarantined is something completely different from the failing test from the stack trace. I'm so confused on what's going here 😕 |
Hmm the stack trace has parts of both tests so maybe some state is being shared between the two?
and
This is a strange one for sure. |
Do these tests execute concurrently? If so, that's a plausible explanation. ActivityListeners/DiagnosticListener are global. If they execute concurrently it makes sense that an ActivityListener callback is firing elsewhere. The fix here would be to add an testing only ctor to Also assuming my hypothesis is right, quarantining doesn't do much since as long as |
Also @tarekgh if you have any suggestions here. Do you have any similar issues with tests in the runtime repo failing because they use the same ActivityName? |
@shirhatti in our runtime repo, we always execute the tests in isolation using the remote executor. Here is some example https://github.com/dotnet/runtime/blob/ab9d49ce146c8f19763b6469e2db7d815c7d9de5/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs#L21 The other idea you can do, use Boolean variable to ensure it will be set to true inside the listener at some point. something like: [Fact]
public void ActivityListenersAreCalled()
{
bool encountered = false;
var hostingApplication = CreateApplication(out var features);
using var listener = new ActivityListener
{
ShouldListenTo = activitySource => true,
Sample = (ref ActivityCreationOptions<ActivityContext> _) => ActivitySamplingResult.AllData,
ActivityStarted = activity =>
{
if ("0123456789abcdef" == activity.ParentSpanId.ToHexString())
{
encountered = true;
}
}
};
ActivitySource.AddActivityListener(listener);
features.Set<IHttpRequestFeature>(new HttpRequestFeature()
{
Headers = new HeaderDictionary()
{
{"traceparent", "00-0123456789abcdef0123456789abcdef-0123456789abcdef-01"},
{"tracestate", "TraceState1"},
{"baggage", "Key1=value1, Key2=value2"}
}
});
hostingApplication.CreateContext(features);
Assert.True(encountered);
} |
All tests in |
@shirhatti @JunTaoLuo This test has a 100% pass rate for the last 30 days. Considering there's a whole class of tests affected, does it makes sense to keep this single test quarantined? |
Yeah, the other tests are a little |
statics are evil |
Build: https://dev.azure.com/dnceng/public/_build/results?buildId=1017405&view=ms.vss-test-web.build-test-results-tab&runId=31669222&resultId=101504&paneView=debug
Log:
The text was updated successfully, but these errors were encountered: