Skip to content

Commit

Permalink
testsuite: cover job ingest with valgrind
Browse files Browse the repository at this point in the history
Have the valgrind sharness test execute everything
under a workload.d subdirectory, then:

workload.d/wreck - content originally from workload.sh
workload.d/job - new coverage for job-ingest, job-manager
  • Loading branch information
garlick committed Jan 17, 2019
1 parent 9ae509a commit c2343f7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ dist_check_SCRIPTS = \
scripts/t0004-event-helper.sh \
scripts/tssh \
valgrind/valgrind-workload.sh \
valgrind/workload.d/wreck \
valgrind/workload.d/job \
kvs/kvs-helper.sh

test_ldadd = \
Expand Down
2 changes: 1 addition & 1 deletion t/t5000-valgrind.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ test_expect_success 'valgrind reports no new errors on single broker run' '
--leak-resolution=med \
--error-exitcode=1 \
--suppressions=$VALGRIND_SUPPRESSIONS \
${BROKER} --shutdown-grace=16 ${VALGRIND_WORKLOAD} 10
${BROKER} --shutdown-grace=16 ${VALGRIND_WORKLOAD}
'
test_done
7 changes: 3 additions & 4 deletions t/valgrind/valgrind-workload.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash

size=$(flux getattr size)
NJOBS=$1
echo FLUX_URI=$FLUX_URI

for i in `seq 1 $NJOBS`; do
flux wreckrun --ntasks $size /bin/true
for file in ${SHARNESS_TEST_SRCDIR:-..}/valgrind/workload.d/*; do
echo Running $(basename $file)
$file
done
15 changes: 15 additions & 0 deletions t/valgrind/workload.d/job
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

runjob() {
local size=$1
flux job submit <<EOT
{"attributes":null,"tasks":[{"slot":"foo","count":{"per_slot":1},"command":"/bin/true"}],"version":1,"resources":[{"count":1,"type":"slot","with":[{"count":${size},"type":"node"}],"label":"foo"}]}
EOT
}

NJOBS=10
NTASKS_PER_JOB=1

for i in `seq 1 $NJOBS`; do
runjob ${NTASKS_PER_JOB}
done
8 changes: 8 additions & 0 deletions t/valgrind/workload.d/wreck
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

size=$(flux getattr size)
NJOBS=10

for i in `seq 1 $NJOBS`; do
flux wreckrun --ntasks $size /bin/true
done

0 comments on commit c2343f7

Please sign in to comment.