From d255f4d90d369487400c100a2bc8d39b69c6726d Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Tue, 29 Mar 2022 14:49:04 -0700 Subject: [PATCH 1/2] testsuite: t0007-ping.t: do not assume short hostnames Problem: A couple tests in `t0007-ping.t` assume short hostnames by using $(hostname -s) as an expected value. This causes failures when the domain is part of the hostname. Change uses of $(hostname -s) to just $(hostname) Fixes #4109 --- t/t0007-ping.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t0007-ping.t b/t/t0007-ping.t index 9e6b3de4362d..77f578f56e9a 100755 --- a/t/t0007-ping.t +++ b/t/t0007-ping.t @@ -138,10 +138,10 @@ test_expect_success 'ping help output works' ' ' test_expect_success 'ping works with hostname' ' - flux ping --count=1 $(hostname -s) + flux ping --count=1 $(hostname) ' test_expect_success 'ping works with hostname!service' ' - flux ping --count=1 "$(hostname -s)!broker" + flux ping --count=1 "$(hostname)!broker" ' test_expect_success 'ping fails with unknown hostname' ' test_must_fail flux ping --count=1 "notmyhost!broker" From e924dbcb93c58c067cd3306ea535b581deddfa41 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Tue, 29 Mar 2022 14:55:05 -0700 Subject: [PATCH 2/2] testsuite: fix potential rounding issue in expiration test Problem: t2900-job-timelimits.t has been seen to fail when flux-jobs rounds the expiration of a job differently than is in the instance R. Since we're not concerned with floating-point seconds for this particular test, be sure to round/truncate the expiration values before comparison by using the existing round() function. --- t/t2900-job-timelimits.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t2900-job-timelimits.t b/t/t2900-job-timelimits.t index 15acde3d2660..fdf6d0d9e8e0 100755 --- a/t/t2900-job-timelimits.t +++ b/t/t2900-job-timelimits.t @@ -29,7 +29,8 @@ test_expect_success HAVE_JQ 'job timelimits are propagated' ' id1=\$(flux mini submit --wait-event=start sleep 300) flux jobs -no "{id.f58} {expiration}" - test "\$(flux jobs -no {expiration} \$id1)" = "\$expiration" + exp1=\$(flux jobs -no {expiration} \$id1) + test "\$(round \$exp1)" = "\$(round \${expiration})" flux job cancelall -f id2=\$(flux mini submit --wait-event=start -t 1m sleep 300)