Testsuite threadsafety

lonetiger at gmail.com lonetiger at gmail.com
Sat Oct 15 09:08:31 UTC 2016


Thanks!
Had missed the spawning of a new process part.

From: Ben Gamari
Sent: Saturday, October 15, 2016 00:12
To: lonetiger at gmail.com; ghc-devs at haskell.org
Subject: Re: Testsuite threadsafety

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 --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20161015/6a3f9e7d/attachment.html>


More information about the ghc-devs mailing list