Fix broken unit tests in GcMemoryLoadCalculatorTests - #9101
Conversation
BenchmarksBenchmark execution time: 2026-08-24 09:20:33 Comparing candidate commit 64626eb in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 70 metrics, 1 unstable metrics, 69 known flaky benchmarks, 57 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9101) and master. ✅ No regressions detected |
Summary of changes
Fixes the new unit tests that only fail on master
Reason for change
The behaviour of
Environment.SetEnvironmentVariable(.., "")is different on < .NET 9, which causes the new unit tests introduced in #9505 to break only on master, where we run .NET 7 and .NET 8. This fixes those testsImplementation details
These tests cases don't work on < .NET 9, because they don't set a
""variable, they instead delete the variable:In .NET 9+ these tests work, as they do set the variable with the
""valueTest coverage
Added a couple of extra cases just to cover other edge cases while I was there.
I'll make sure to do a full TFM run to be sure it's fixed
Other details
Currently causing failures on master (not PRs) so high urgency