]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/200-urgency-timer.t
Merge pull request #3445 from orestisf1993/flaky
[i3/i3] / testcases / t / 200-urgency-timer.t
index 730a950a4aea8f316056f77e8d23c76831c365ed..6d2f2bd825872076758259757ecaed5923d5cdae 100644 (file)
@@ -2,13 +2,13 @@
 # vim:ts=4:sw=4:expandtab
 #
 # Please read the following documents before working on tests:
-# • http://build.i3wm.org/docs/testsuite.html
+# • https://build.i3wm.org/docs/testsuite.html
 #   (or docs/testsuite)
 #
-# • http://build.i3wm.org/docs/lib-i3test.html
+# • https://build.i3wm.org/docs/lib-i3test.html
 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
 #
-# • http://build.i3wm.org/docs/ipc.html
+# • https://build.i3wm.org/docs/ipc.html
 #   (or docs/ipc)
 #
 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
 #
 
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-use Time::HiRes qw(sleep);
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
-force_display_urgency_hint 150ms
+force_display_urgency_hint 500ms
 EOT
-my $pid = launch_with_config($config);
+use Time::HiRes qw(sleep);
 
 #####################################################################
 # Initial setup: one window on ws1, empty ws2
@@ -70,7 +63,7 @@ is(@urgent, 1, 'window still marked as urgent');
 # now check if the timer was triggered
 cmd "workspace $tmp2";
 
-sleep(0.1);
+sleep(0.5);
 @content = @{get_ws_content($tmp1)};
 @urgent = grep { $_->{urgent} } @content;
 is(@urgent, 0, 'window not marked as urgent anymore');
@@ -85,6 +78,7 @@ my $w2 = open_window;
 is($x->input_focus, $w2->id, 'window 2 focused');
 
 cmd "workspace $tmp2";
+$w->delete_hint('urgency');
 $w->add_hint('urgency');
 sync_with_i3;
 
@@ -141,9 +135,7 @@ cmd "workspace $tmp3";
 $split_left->delete_hint('urgency');
 sync_with_i3;
 
-sleep(0.2);
+sleep(0.6);
 is(count_total_urgent(get_ws($tmp3)), 0, "no more urgent windows on workspace $tmp3");
 
-exit_gracefully($pid);
-
 done_testing;