Skip to content

Commit b863cec

Browse files
committed
testsuite: workaround possible bind() to hostname interface
Problem: A test in t0019-tbon-config.t fails in github ci with an error error binding to tcp://10.1.1.7:*: Cannot assign requested address This occurs when `--network=host` is used with docker in the github runner environment for unknown reason. Work around the failure by allowing the test to pass either if the `flux start` invocation succeeds, or if the test encounters the error above. Fixes #6812
1 parent 3b1ad4c commit b863cec

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

t/t0019-tbon-config.t

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,18 @@ test_expect_success 'tbon.interface-hint=default-route works' '
7676
flux start -Stbon.interface-hint=default-route -Stbon.prefertcp=1 \
7777
${ARGS} -s2 true
7878
'
79+
# Note: the following test may fail if for some reason bind() fails on the
80+
# interface associated with the hostname. This may occur, for example, under
81+
# docker with --network=host when the host does not allow processes to bind
82+
# to the shared interface. Therefore allow success or a specific error to
83+
# determine success of this test.
7984
test_expect_success 'tbon.interface-hint=hostname works' '
80-
flux start -Stbon.interface-hint=hostname -Stbon.prefertcp=1 \
81-
${ARGS} -s2 true
85+
test_might_fail flux start \
86+
-Stbon.interface-hint=hostname \
87+
-Stbon.prefertcp=1 \
88+
${ARGS} -s2 echo ok >interface-hostname.out 2>&1 &&
89+
(grep ok interface-hostname.out ||
90+
grep "Cannot assign requested address" interface-hostname.out)
8291
'
8392
test_expect_success 'tbon.interface-hint defaults to default-router' '
8493
flux start ${ARGS} flux getattr tbon.interface-hint >defhint.out &&

0 commit comments

Comments
 (0)