-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Milestone
Description
It is empty, causing these tests to fail:
- System.Tests.EnvironmentStackTrace.StackTraceDoesNotStartWithInternalFrame
fails withSystem.NullReferenceException.
Failure Message:
[FAIL] System.Tests.EnvironmentStackTrace.StackTraceDoesNotStartWithInternalFrame
System.NullReferenceException : Object reference not set to an instance of an object.
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Calling Code:
public void StackTraceDoesNotStartWithInternalFrame()
{
string stackTrace = Environment.StackTrace;
// Find first line of the stacktrace and verify that it is Environment.get_StackTrace itself, not an internal frame
string firstFrame = new StringReader(stackTrace).ReadLine();
Assert.True(firstFrame.IndexOf("System.Environment.get_StackTrace()") != -1);
}
For Browser WASM, Environment.StackTrace is empty, which leads to a null return in StringReader.cs's method ReadLine. Therefore, it cannot access IndexOf.
- System.Diagnostics.TraceSourceTests.TraceEventCacheClassTests.CallstackTest_NotEmpty
Assert.NotEmpty() Failure
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
- System.Diagnostics.TraceSourceTests.TraceEventCacheClassTests.CallstackTest_ContainsExpectedFrames
Assert.Contains() Failure
Not found: System.Environment.get_StackTrace()
- System.Diagnostics.TraceSourceTests.TraceListenerClassTests.WriteFooterTest_Callstack
Assert.Contains() Failure
Not found: WriteFooterTest_Callstack