Opened 3 years ago

Closed 3 years ago

#5338 closed bug (fixed)

Race hazard in Random library test suite

Reported by: simonpj Owned by: rrnewton
Priority: normal Milestone:
Component: libraries/random Version: 7.0.3
Keywords: Cc: rrnewton@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

In a validate run, rangeTest fails thus

=====> rangeTest(normal) 2838 of 2886 [0, 4, 0]
cd ../../../libraries/random/tests && '/64playpen/simonpj/builds/HEAD-1/bindisttest/install dir/bin/ghc' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts  -o rangeTest rangeTest.hs  -i.. -XCPP   >rangeTest.comp.stderr 2>&1
=====> random1283(normal) 2839 of 2886 [0, 4, 0]
cd ../../../libraries/random/tests && '/64playpen/simonpj/builds/HEAD-1/bindisttest/install dir/bin/ghc' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts  -o random1283 random1283.hs  -i.. -XCPP  -package containers  >random1283.comp.stderr 2>&1
Compile failed (status 256) errors were:
[1 of 2] Compiling System.Random    ( ../System/Random.hs, ../System/Random.o )
[2 of 2] Compiling Main             ( rangeTest.hs, rangeTest.o )
Linking rangeTest ...
../System/Random.o: file not recognized: File truncated
collect2: ld returned 1 exit status

*** unexpected failure for rangeTest(normal)

Ian writes:
The problem is this, in libraries/random/tests/all.T:

    # This lets me run tests from the test directory during development:
    opts = '-i.. -XCPP '

This is causing all the tests to compile the source, rather than using
the package. If two of the tests get run in parallel then there is a
race condition.

Ryan, could you handle this differently, so those flags don't get passed
by default, please? Perhaps have them conditionally set, based on
whether a file has been 'touch'ed or whether a make variable has been
set, or maybe make a testsuite wrapper for yourself which builds the
package so that they aren't necessary?

Change History (6)

comment:1 Changed 3 years ago by rrnewton

Ah, it looks like my first attempt to add a new test was bungled.

Does it seem like simply removing the opts line is a sufficient fix? I believe so. Therefore I've checked in that small change.

Alas, I'm running into other problems when I try to validate GHC on my mac/ubuntu machines so for the time being I can't test this properly through the normal harness.

comment:2 Changed 3 years ago by rrnewton

  • Status changed from new to patch

comment:3 Changed 3 years ago by rrnewton

  • Owner changed from rrnewton@… to rrnewton

comment:4 Changed 3 years ago by rrnewton

  • Status changed from patch to merge

comment:5 Changed 3 years ago by rrnewton

  • Component changed from Compiler to libraries/random

comment:6 Changed 3 years ago by igloo

  • Resolution set to fixed
  • Status changed from merge to closed

changeset:806f9fb0431d542821e22dac927169307faf8a35 is now in the GHC HEAD repo, thanks!

Note: See TracTickets for help on using tickets.