asterius icon indicating copy to clipboard operation
asterius copied to clipboard

Testing asterius hangs due to an undetected loop in test (T2783)

Open gkaracha opened this issue 4 years ago • 0 comments

Describe the bug Running the testsuite for asterius (stack test asterius) hangs when it reaches test file test/ghc-testsuite/rts/T2783.hs.

To Reproduce In the top directory of asterius, run stack test asterius.

Expected behavior Testing should either kill this specific test (with an expected/unexpected failure), or maybe ahc should detect the loop (like GHC does). Either way, running the tests should not hang on this test.

Environment

  • OS name + version: Ubuntu 18.04.4 LTS (bionic)
  • GHC version: 8.8.3
  • Cabal version: 3.0.1.0
  • Version of Asterius: current HEAD (https://github.com/tweag/asterius/commit/3dda53f4a70201b380920227a5ae6d65ed88252a)

Additional context By looking into the issue more closely, I realized that the test itself is meant to loop. It looks as follows:

main = print $ do x <- [ 0 .. 5 ] ; let { y = 5 - y } ; return y   -- not y = 5 - x

I assume that this is a test for the loop detector, because on my system I get the following:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5

$ ghc T2783.hs && ./T2783
[1 of 1] Compiling Main             ( T2783.hs, T2783.o )
Linking T2783 ...
T2783: <<loop>>

which means that there are two separate ways to see this issue:

  1. ahc does not detect the loop while GHC does
  2. the test is allowed to run forever

For now I'd argue that we can deactivate/drop this specific test. Might be worthwhile in the future to limit resources when running tests though to avoid such regressions.

gkaracha avatar Apr 10 '20 11:04 gkaracha