diff --git a/src/coreclr/tools/r2rtest/Crossgen2Runner.cs b/src/coreclr/tools/r2rtest/Crossgen2Runner.cs index 2aa1dee6b6f6d0..d903ff4e2b0ab1 100644 --- a/src/coreclr/tools/r2rtest/Crossgen2Runner.cs +++ b/src/coreclr/tools/r2rtest/Crossgen2Runner.cs @@ -65,6 +65,10 @@ public override ProcessParameters CompilationProcess(string outputFileName, IEnu { ProcessParameters processParameters = base.CompilationProcess(outputFileName, inputAssemblyFileNames); processParameters.Arguments = $"{Crossgen2Path} {processParameters.Arguments}"; + processParameters.EnvironmentOverrides["COMPlus_GCStress"] = ""; + processParameters.EnvironmentOverrides["COMPlus_HeapVerify"] = ""; + processParameters.EnvironmentOverrides["COMPlus_ReadyToRun"] = ""; + processParameters.EnvironmentOverrides["COMPlus_GCName"] = ""; return processParameters; } diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets index 3590d4e4affea0..6075c74b6d297c 100644 --- a/src/tests/Common/CLRTest.CrossGen.targets +++ b/src/tests/Common/CLRTest.CrossGen.targets @@ -87,9 +87,9 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then local heapVerifyModeToRestore=$COMPlus_HeapVerify; local readyToRunModeToRestore=$COMPlus_ReadyToRun; local gcstandaloneModeToRestore=$COMPlus_GCName; - export COMPlus_GCStress= - export COMPlus_HeapVerify= - export COMPlus_ReadyToRun= + unset COMPlus_GCStress + unset COMPlus_HeapVerify + unset COMPlus_ReadyToRun unset COMPlus_GCName __Command=$_DebuggerFullPath