[monitoring-plugins] tests: use Time::HiRes for fractional sleeps in ...

Lorenz Kästle git at monitoring-plugins.org
Wed Nov 4 10:30:13 CET 2026


    Module: monitoring-plugins
    Branch: master
    Commit: 3889c595836dd5ef1a9d35bf326cd4aa28c8d63f
    Author: Christopher Kreft <email at christopherkreft.de>
 Committer: Lorenz Kästle <lorenz.kaestle at mailbox.org>
      Date: Tue Nov  3 11:13:55 2026 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=3889c595

tests: use Time::HiRes for fractional sleeps in check_ssh

Perl's built-in sleep truncates fractional seconds to zero, so the
existing sleep 0.1 calls did not provide the intended delay.

Import Time::HiRes::sleep to allow netcat time to start before
connecting, reducing the risk of intermittent test failures.

---

 plugins/t/check_ssh.t | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/t/check_ssh.t b/plugins/t/check_ssh.t
index 8a20782e..5e7e3cbf 100644
--- a/plugins/t/check_ssh.t
+++ b/plugins/t/check_ssh.t
@@ -7,6 +7,7 @@
 use strict;
 use warnings;
 use Test::More;
+use Time::HiRes qw(sleep);
 use NPTest;
 use JSON;
 



More information about the Commits mailing list