Testsuite threadsafety

lonetiger at gmail.com lonetiger at gmail.com
Fri Oct 14 22:59:03 UTC 2016


Hi *,

I’m trying to understand  a few pieces of code in the testsuite,

As it so happens quite a few tests randomly fail on newer msys2 and python installs:

   r:/temp/ghctest-0u4c8o/test   spaces/./th/T12407.run                                    T12407 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12407.run')
   r:/temp/ghctest-0u4c8o/test   spaces/./th/T11463.run                                    T11463 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T11463.run')
   r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_4.run                                  T12478_4 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_4.run')
   r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_3.run                                  T12478_3 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_3.run')

(I say random, but the set of tests seem to be the same ones, just within that group a few randomly pass every so often. It’s mostly TH tests.)

Anyone have any ideas? I’m not very familiar with the internals of the testsuite.

Secondly, I’ve noticed all paths in the testsuite are relative paths. And this hand me wondering, relative to what. 

I see that in do_test we actually change directories

837     if opts.pre_cmd: 
838         exit_code = runCmd('cd "{0}" && {1}'.format(opts.testdir, opts.pre_cmd))

So I am now assuming that the relative paths are relative to the cwd. Which brings up the question.. how is this thread safe and working on Linux?

Surely any two tests can change the cwd and then one of them would be writing to the wrong place? Am I missing something here?

Cheers,
Tamar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20161014/e563e739/attachment.html>


More information about the ghc-devs mailing list