Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,27 @@ public void AddEnvironmentVariablesUsingPrefixWithDoubleUnderscores_Bind_PrefixM

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void BindingDoesNotThrowIfReloadedDuringBinding()
{
// Instrumentation for https://github.com/dotnet/runtime/issues/109904. Failfast to generate a crash dump when the test fails with NullReferenceException.
try
{
BindingDoesNotThrowIfReloadedDuringBindingWorker();
}
catch (NullReferenceException) when (FailFast())
{
}

static bool FailFast()
{
Environment.FailFast(
"Instrumentation for https://github.com/dotnet/runtime/issues/109904" + Environment.NewLine +
"Microsoft.Extensions.Configuration.EnvironmentVariables.Test.EnvironmentVariablesTest.BindingDoesNotThrowIfReloadedDuringBinding [FAIL]" + Environment.NewLine +
"System.NullReferenceException : Object reference not set to an instance of an object.");
return false;
}
}

private void BindingDoesNotThrowIfReloadedDuringBindingWorker()
{
var dic = new Dictionary<string, string>
{
Expand Down
Loading