I'm not 100% sure all of them are the same thing, and I can only reproduce one failure locally, but I suspect they might. In any case if the foreground window is wrong it's simply not going to work.
-- v2: dinput/tests: Mark some tests as flaky to workaround fvwm bug.