When running some test in a loop for many times, after the test has finished XOrg continues to eat up most of CPU resources (can be seen from "top" command's output), thus resulting in lagging desktop experience. Only restarting PC brings things back to normal.
The described issues can be reproduced by running ./tst_qwindow testInputEvents 1000x in a loop (but I have seen the same issue when running 200x in a loop, don't remember which test exactly). Reproducing this issue is somewhat difficult.
When trying to run ./tst_qwindow again, with desktop is in this lagging state, tst_QWindow::isActive starts to fail. The same function fails in CI too once in a while, maybe for the same reasons.