[JitStressRegs=0x80] System.Linq.Expressions.Tests fails
Configuration
Debug CoreCLR runtime: coreclr.dll, corerun.exe and mscorlib.dll CoreFX assemblies and CoreFX tests: release
** Run run-test with sudo ** to avoid corefx test hang
Failed tests
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Divide [FAIL] Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_ModuloAssign [FAIL] Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Modulo [FAIL] Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_DivideAssign [FAIL]
./System.Linq.Expressions.Tests/testResults.xml: <test name="Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Divide" type="Tests.Expressions.InterpreterTests" method="CompileInterpretCrossCheck_Divide" time="1.6545951" result="Fail">
./System.Linq.Expressions.Tests/testResults.xml: <test name="Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_ModuloAssign" type="Tests.Expressions.InterpreterTests" method="CompileInterpretCrossCheck_ModuloAssign" time="9.3714908" result="Fail">
./System.Linq.Expressions.Tests/testResults.xml: <test name="Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Modulo" type="Tests.Expressions.InterpreterTests" method="CompileInterpretCrossCheck_Modulo" time="1.4593054" result="Fail">
./System.Linq.Expressions.Tests/testResults.xml: <test name="Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_DivideAssign" type="Tests.Expressions.InterpreterTests" method="CompileInterpretCrossCheck_DivideAssign" time="10.0560968" result="Fail">
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Divide [FAIL]
System.Exception : Error for expression '-2147483648 / -1':
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: typeof(System.DivideByZeroException)
Actual: typeof(System.OverflowException)
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer)
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
Stack Trace:
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
at Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Divide()
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_ModuloAssign [FAIL]
System.Exception : Error for expression '.Block(System.Int32 $var1) {
$var1 = -2147483648;
$var1 %= -1
}':
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: typeof(System.DivideByZeroException)
Actual: typeof(System.OverflowException)
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer)
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
Stack Trace:
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
at Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_ModuloAssign()
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Throw [SKIP]
3995
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Dynamic [SKIP]
3995
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Modulo [FAIL]
System.Exception : Error for expression '-2147483648 % -1':
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: typeof(System.DivideByZeroException)
Actual: typeof(System.OverflowException)
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer)
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
Stack Trace:
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
at Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Modulo()
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Label [SKIP]
3995
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_Try [SKIP]
3995
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_ConvertChecked [SKIP]
4022
Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_DivideAssign [FAIL]
System.Exception : Error for expression '.Block(System.Int32 $var1) {
$var1 = -2147483648;
$var1 /= -1
}':
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: typeof(System.DivideByZeroException)
Actual: typeof(System.OverflowException)
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer)
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
Stack Trace:
at Tests.Expressions.InterpreterTests.Verify(Expression expr)
at Tests.Expressions.InterpreterTests.CompileInterpretCrossCheck_DivideAssign()
Finished: System.Linq.Expressions.Tests
Dup of dotnet/runtime#4792
@sejongoh I have just looked at the log from the test again and I can see that I have misread the description, thinking that it is failing on Unix while it was on Windows instead. So it is unrelated to the dotnet/runtime#4792. But looking at the log from the test that you have pasted above, it seems that the test itself is wrong. Dividing the minimum 32 bit negative value (-2147483648) by -1 is an overflow and not a division by zero. So the actual exception thrown is correct.
Thank you for the update. I don't see the failure without JitStressRegs=0x80. Could the test value depend on it?
@sejongoh I am unable to reproduce the issue. Even with JitStressRegs=0x80 set, the test passes for me. Since you've tested it 19 days ago, could you please try again?
@sejongoh I am sorry, I had a typo in the in the COMPlus_JitStressRegs, I am trying it again now.
I was able to repro it now.
@sejongoh The reason why I have thought the test is wrong is just the fact that it reports the failure incorrectly. The "expected" and "actual" exceptions are swapped. But the test itself is correct.
Fixed by dotnet/coreclr#2543