Since this test runs with multiple domains, we cannot mutate plain refs as we were without inviting data races.
As soon as we start running this in multible system threads, the race to trigger the globals `stop` and `iterations` makes the signal emissions non-deterministic, which makes the test kind of meaningless. This change should make them determinstic.