Skip to content

Commit

Permalink
testsuite: fix potential race in t4011-match-duration.t
Browse files Browse the repository at this point in the history
Problem: There is a potential race condition in the test in
t4011-match-duration.t that ensures that Fluxion updates the
internal expiration of its resource set when running as a job with an
expiration update. The problem occurs because the scheduler update is
asynchronous with respect to the instance update, which is detected
via a resource-update event in the resource.eventlog.

Wait for the scheduler to receive the updated expiration by blocking
in the test until a log message is posted that the update has been
processed.
  • Loading branch information
grondo committed Nov 14, 2023
1 parent c5c1fe5 commit 8293151
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/t4011-match-duration.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ test_under_flux 2
flux setattr log-stderr-level 1
export FLUX_URI_RESOLVE_LOCAL=t

dmesg_grep="flux python ${SHARNESS_TEST_SRCDIR}/scripts/dmesg-grep.py"

# Ensure fluxion modules are loaded under flux-alloc(1)
test_expect_success 'set FLUX_RC_EXTRA so Fluxion modules are loaded under flux-alloc' '
mkdir rc1.d &&
Expand Down Expand Up @@ -101,7 +103,7 @@ test_expect_success FLUX_UPDATE_RUNNING \
test_debug "echo instance expiration is $exp1" &&
id1=$(flux proxy $id flux submit sleep 300) &&
duration1=$(subinstance_get_job_duration $id $id1) &&
test_debug "echo initial duration of subinstance job1 is $duration1" &&
echo initial duration of subinstance job1 is $duration1 &&
echo $duration1 | jq -e ". < 300" &&
test_debug "echo updating duration of alloc job +5m" &&
flux update $id duration=+5m &&
Expand All @@ -111,6 +113,8 @@ test_expect_success FLUX_UPDATE_RUNNING \
exp2=$(subinstance_get_expiration $id) &&
test_debug "echo expiration updated from $exp1 to $exp2" &&
echo $exp2 | jq -e ". == $exp1 + 300" &&
flux proxy $id $dmesg_grep -vt 30 \
\"sched.*resource expiration updated\" &&
id2=$(flux proxy $id flux submit sleep 300) &&
duration2=$(subinstance_get_job_duration $id $id2) &&
test_debug "echo duration of subinstance job2 is $duration2" &&
Expand Down

0 comments on commit 8293151

Please sign in to comment.