Skip to content

Commit f341232

Browse files
committed
testsuite: add eventlog overwrite regression test
Problem: A regression test for issue #4612, where an overwrite of a job eventlog can lead to a broker crash, does not exist. Add a reproducer of the original bug.
1 parent c5003ce commit f341232

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

t/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ dist_check_SCRIPTS = \
312312
issues/t4413-empty-eventlog.sh \
313313
issues/t4465-job-list-use-after-free.sh \
314314
issues/t4482-flush-list-corruption.sh \
315+
issues/t4612-eventlog-overwrite-crash.sh \
315316
python/__init__.py \
316317
python/subflux.py \
317318
python/tap \
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash -e
2+
3+
waitfile=${SHARNESS_TEST_SRCDIR}/scripts/waitfile.lua
4+
5+
jobid=$(flux mini submit --wait-event=start sh -c "echo foo; sleep 300")
6+
7+
kvsdir=$(flux job id --to=kvs $jobid)
8+
9+
# issue a command that will watch / monitor the job's eventlog
10+
flux job attach $jobid > t4612.out &
11+
12+
# ensure backgrounded process has started to monitor eventlog
13+
$waitfile --count=1 --timeout=30 --pattern=foo t4612.out
14+
15+
# now overwrite the eventlog without changing its length
16+
flux kvs get --raw ${kvsdir}.eventlog \
17+
| sed -e s/submit/foobar/ \
18+
| flux kvs put --raw ${kvsdir}.eventlog=-
19+
20+
wait
21+
22+
# if flux broker segfaulted, this won't work
23+
flux mini run hostname

0 commit comments

Comments
 (0)