summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/clients/pointer-scroll.cpp
diff options
context:
space:
mode:
authorArchSav <96357545+ArchSav@users.noreply.github.com>2025-12-31 23:08:40 +1100
committerGitHub <noreply@github.com>2025-12-31 13:08:40 +0100
commitd622c09d09094eba49f6e219c81059ee0be548c2 (patch)
treeab00a6632664b6786071f49d07e75af4734ad9cd /hyprtester/src/tests/clients/pointer-scroll.cpp
parent529559712bbfa9c8d79fe01770a77e925a7a0496 (diff)
tester: fix sleeps waiting for too long (#12774)
Diffstat (limited to 'hyprtester/src/tests/clients/pointer-scroll.cpp')
-rw-r--r--hyprtester/src/tests/clients/pointer-scroll.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/hyprtester/src/tests/clients/pointer-scroll.cpp b/hyprtester/src/tests/clients/pointer-scroll.cpp
index 2ea93a14..d54d82de 100644
--- a/hyprtester/src/tests/clients/pointer-scroll.cpp
+++ b/hyprtester/src/tests/clients/pointer-scroll.cpp
@@ -42,6 +42,7 @@ static bool startClient(SClient& client) {
client.readFd = CFileDescriptor(pipeFds2[0]);
client.proc->setStdoutFD(pipeFds2[1]);
+ const int COUNT_BEFORE = Tests::windowCount();
client.proc->runAsync();
close(pipeFds1[0]);
@@ -62,7 +63,16 @@ static bool startClient(SClient& client) {
}
// wait for window to appear
- std::this_thread::sleep_for(std::chrono::milliseconds(5000));
+ int counter = 0;
+ while (Tests::processAlive(client.proc->pid()) && Tests::windowCount() == COUNT_BEFORE) {
+ counter++;
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+ if (counter > 50) {
+ NLog::log("{}pointer-scroll client took too long to open", Colors::RED);
+ return false;
+ }
+ }
if (getFromSocket(std::format("/dispatch setprop pid:{} no_anim 1", client.proc->pid())) != "ok") {
NLog::log("{}Failed to disable animations for client window", Colors::RED, ret);