Problem was setting DEBUG_SYNC twice in a row too fast in the test case; this
could cause the second setting to override the first before the code had time
to react to the first, causing the signal to get lost.
Fixed by waiting for the code to receive the first signal before overwriting
it in the test case.