Ticket #1558 (closed bug: fixed)

Opened 6 years ago

Last modified 4 years ago

make the testsuite work with THREADS=2

Reported by: simonmar Owned by: igloo
Priority: high Milestone: 6.10 branch
Component: Test Suite Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

The testsuite driver supports THREADS=2, unfortunately there are a few sequencing dependencies in the tests themselves which means that you may get false failures, depending on the order in which the tests are run.

These are the tests I know about that fail in this way:

cabal01(normal)
ffi018(normal)
mod144(normal)
mod158(normal)
mod166(normal)

Change History

Changed 6 years ago by simonmar

  • description modified (diff)

Changed 6 years ago by simonmar

Also, I get a number of framework failures when running with THREADS=2:

OVERALL SUMMARY for test run started at Wed Aug  1 15:15:16 BST 2007
    1829 total tests, which gave rise to
    7144 test cases, of which
      74 caused framework failures
    5607 were skipped

    1405 expected passes
      55 expected failures
       0 unexpected passes
       3 unexpected failures

Unexpected failures:
   cabal01(normal)
   mod144(normal)
   mod167(normal)

e.g.

=====> getEnvironment01(normal)
cd ../../../libraries/unix/tests && '/64playpen/simonmar/testing/compiler/stage2/ghc-inplace' -no-recomp -dcore-lint -dcmm-lint -Dx86_64_unknown_linux  -o getEnvironment01 getEnvironment01.hs  -package unix  >getEnvironment01.comp.stderr 2>&1
Compile failed (status 6656) errors were:
*** framework failure for getEnvironment01(normal) :
Traceback (most recent call last):
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 428, in do_test
    result = apply(func, [name,way] + args)
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 586, in compile_and_run
    return compile_and_run__( name, way, extra_hc_opts, '' , '')
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 573, in compile_and_run__
    result = simple_build( name, way, extra_hc_opts, 0, top_mod, 1 )
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 635, in simple_build
    if_verbose(1,open(actual_stderr).read())
IOError: [Errno 2] No such file or directory: '../../../libraries/unix/tests/getEnvironment01.comp.stderr'

This could be a bug in Python, perhaps related to signals and spawning processes.

Changed 6 years ago by simonmar

I have fixed the ordering constraints and the framework failures noted above. However, with 'THREADS=2' I'm still occasionally getting a different kind of framework failure, So I'll leave the bug open and validate is still defaulting to unthreaded. We're very close now, though.

Changed 6 years ago by simonmar

Here's one of those framework failures, on x86_64/Linux:

=====> signals002(normal)
cd ../../../libraries/unix/tests && '/64playpen/simonmar/testing/compiler/stage2/ghc-inplace' -no-recomp -dcore-lint -dcmm-lint -Dx86_64_unknown_linux  -o signals002 signals002.hs  -package unix  >signals002.comp.stderr 2>&1
cd ../../../libraries/unix/tests && ./signals002    </dev/null >signals002.run.stdout 2>signals002*** framework failure for conc027(normal) :
Traceback (most recent call last):
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 445, in do_te
st
    result = apply(func, [name,way] + args)
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 603, in compi
le_and_run
    return compile_and_run__( name, way, extra_hc_opts, '' , '')
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 590, in compi
le_and_run__
    result = simple_build( name, way, extra_hc_opts, 0, top_mod, 1 )
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 647, in simpl
e_build
    result = runCmd(cmd)
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 1115, in runC
md
    r = rawSystem([config.timeout_prog, str(config.timeout), cmd])
  File "/home/simonmar/darcs-all/work/ghc-testing/testsuite/driver/testlib.py", line 1092, in rawS
ystem
    return subprocess.call(cmd_and_args)
  File "/usr/lib64/python2.4/subprocess.py", line 412, in call
    return Popen(*args, **kwargs).wait()
  File "/usr/lib64/python2.4/subprocess.py", line 1007, in wait
    pid, sts = os.waitpid(self.pid, 0)
OSError: [Errno 10] No child processes

Changed 6 years ago by simonmar

  • milestone changed from 6.8 branch to 6.10 branch

Changed 5 years ago by igloo

Having had a quick look at the above bug report and the code, I think that this has been fixed. In my python 2.4.4 I have

def _cleanup():
    for inst in _active[:]:
        inst.poll()

(poll calls _active.remove(self)) while in my 2.5.2 I have

def _cleanup():
    for inst in _active[:]:
        if inst.poll(_deadstate=sys.maxint) >= 0:
            try:
                _active.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Popen instance.
                # It's harmless that it was already removed, so ignore.
                pass

and I think that caught exception is the one that we are seeing.

Even if it is not fixed, I think that we could work around it by wrapping the Popen class in our own class, and taking a lock before calling the Popen constructor.

Changed 5 years ago by simonmar

  • priority changed from normal to high

Changed 5 years ago by igloo

  • owner set to igloo

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Now fixed, if you have python >= 2.5.2. I've fixed a few problems with specific tests, but there might be more as it's non-deterministic.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.