diff --git a/src/cmd/flux-resource.py b/src/cmd/flux-resource.py index 00610aa458a6..2377522af95f 100755 --- a/src/cmd/flux-resource.py +++ b/src/cmd/flux-resource.py @@ -734,7 +734,9 @@ def eventlog(args): evf = EventLogFormatter( format=args.format, timestamp_format=args.time_format, color=args.color ) - consumer = ResourceJournalConsumer(h, include_sentinel=True).start() + # The sentinel event is only used if we're not following the eventlog: + sentinel = not args.follow + consumer = ResourceJournalConsumer(h, include_sentinel=sentinel).start() while True: event = consumer.poll() if event is None or event.is_empty(): diff --git a/t/t2355-resource-journal.t b/t/t2355-resource-journal.t index a75d55dcc205..ccdc7c019c93 100755 --- a/t/t2355-resource-journal.t +++ b/t/t2355-resource-journal.t @@ -119,8 +119,10 @@ test_expect_success 'that event WAS posted to the KVS' ' test $(grep resource-define kvs2 | wc -l) -eq 2 ' test_expect_success NO_CHAIN_LINT 'watch eventlog in the background waiting on drain' ' - flux resource eventlog -F --wait=drain >bgeventlog & - echo $! >bgpid + flux resource eventlog -HF --wait=drain >bgeventlog & + echo $! >bgpid && + # ensure RPC is established before moving on + waitfile.lua -vt 15 bgeventlog ' test_expect_success NO_CHAIN_LINT 'drain rank 1' ' flux resource drain 1 @@ -128,7 +130,10 @@ test_expect_success NO_CHAIN_LINT 'drain rank 1' ' test_expect_success NO_CHAIN_LINT 'background watcher completed successfully' ' wait $(cat bgpid) ' - +test_expect_success NO_CHAIN_LINT 'background watcher waited for drain event' ' + test_debug "cat bgeventlog" && + tail -1 bgeventlog | grep drain +' test_expect_success 'run restartable flux instance, drain 0' ' flux start --setattr=statedir=$(pwd) \ sh -c "flux resource eventlog --wait=resource-define \