Peter Maydell <peter.mayd...@linaro.org> writes: > On Thu, 8 Sept 2022 at 16:54, Patrick Venture <vent...@google.com> wrote: >> On Wed, Sep 7, 2022 at 10:40 AM Peter Maydell <peter.mayd...@linaro.org> >> wrote: >>> Have a look in the source at what exactly the assertion >>> failure in libqtest.c is checking for -- IIRC it's a pretty >>> basic "did we open a socket fd" one. I think sometimes I >>> used to see something like this if there's an old stale socket >>> lying around in the test directory and the randomly generated >>> socket filename happens to clash with it. > >> Thanks for the debugging tip! I can't reproduce it at this point. I >> saw it 2-3 times, and now not at all. So more than likely it's >> exactly what you're describing. > > Mmm. We do clean up the socket after ourselves in the test > harness, but I think what can happen is that if a test case > crashes then the cleanup doesn't happen. Then there's a stale > file left in the build tree, and then you only hit it if you > get unlucky with PID allocation on a future run...
Yes, and that's bad behavior. I think we should run each test in its own directory, which we delete afterwards. That way anything the test creates there will be cleaned up whether it succeeds or fails.