test: wait for the watchdog to stop between tests

Merged
ST
23d ago
+24-2

Flaked on #73's macos job. test_exits_once_the_worker_overruns_its_deadline leaves its watchdog firing every 10ms and teardown only sets the stop event, so on a slow runner the thread can wake up in the next test and call that test's _exit_wedged mock (the captured setup log said "1.1s past its deadline", which is the previous test's deadline). Fixture now joins the watchdog before the mocks come off.

Reproduced locally by putting a 50ms sleep before the exit call, fails without the join and passes with it.

Also points every test at a temp socket and pid file. A stray real _exit_wedged during a local test run deleted my live daemon's socket, so the daemon kept running but nothing could reach it and callouts just stopped.