hylo icon indicating copy to clipboard operation
hylo copied to clipboard

Nondeterministic test failure

Open dabrahams opened this issue 2 years ago • 5 comments

I've seen this happen several times (without parallel testing enabled FWIW):

Test Case '-[LibraryTests.LibraryTests test_compileAndRun_OptionalTests]' started.
/Users/dave/src/hylo/Tests/LibraryTests/TestCases/OptionalTests.hylo:1: error: -[LibraryTests.LibraryTests test_compileAndRun_OptionalTests] : success was expected, but processing failed with thrown error: NonzeroExit(
  terminationStatus: 6,
  standardOutput: "/Users/dave/src/hylo/Tests/LibraryTests/TestCases/OptionalTests.hylo:10: precondition failure\n",
  standardError: "",
  commandLine: ["/var/folders/f3/48cjbvxd0sx81ld0qm__zqrc0000gn/T/83CF26FA-3963-4623-AE36-1256AC0165C9"])
Test Case '-[LibraryTests.LibraryTests test_compileAndRun_OptionalTests]' failed (6.646 seconds).

It's just this one test, as far as I can tell.

dabrahams avatar Nov 08 '23 15:11 dabrahams

This seems to happen a bit more reliably in CI when parallel testing is enabled, FWIW.

dabrahams avatar Nov 08 '23 17:11 dabrahams

Here's another example: https://github.com/hylo-lang/hylo/actions/runs/6802288428/job/18495069171#step:4:3081 Parallel testing happens to be off in this configuration

dabrahams avatar Nov 08 '23 18:11 dabrahams

Looks like a very nasty bug. I've been completely unable to reproduce it on my machine so far. The thing about parallel testing sounds like a red herring, as I suspect the real culprit is UB.

I'll have to get my hands on Hylo IR and LLVM IR to understand what's going on.

kyouko-taiga avatar Nov 14 '23 09:11 kyouko-taiga

I suggest reducing the test case first if possible.

What architecture is your machine?

dabrahams avatar Nov 14 '23 17:11 dabrahams

I'll have to get my hands on Hylo IR and LLVM IR to understand what's going on.

LLVM IR looks good to me if I compile on my machine. I am not 100% positive because there's a lot of noise due to unnecessary pointers to Void allocas, as mentioned yesterday.

I worry that we may have to insert debug info into the executable to investigate further with lldb.

I suggest reducing the test case first if possible.

Good idea. I tried on my machine but not on CI.

What architecture is your machine?

I use an Apple M1. Am I correct to assume the bug only occurs on Ubuntu? I think CI uses x86 for this OS, but I am not sure.

kyouko-taiga avatar Nov 15 '23 07:11 kyouko-taiga