Testsuite threadsafety

Ben Gamari ben at smart-cactus.org
Fri Oct 14 23:12:03 UTC 2016


lonetiger at gmail.com writes:

> 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))
>
If I understand this correctly, this is merely spawning off a child
shell process which then moves its own cwd to opts.testdir. This should
not affect the cwd of the testsuite driver, which means that it should
be perfectly safe.

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 454 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20161014/bf7b87d0/attachment-0001.sig>


More information about the ghc-devs mailing list