Skip to content

Commit

Permalink
Merge pull request #1464 from grondo/test-fixes
Browse files Browse the repository at this point in the history
fixes for broken tests, addition to gitignore
  • Loading branch information
garlick authored Apr 14, 2018
2 parents 0ebaf83 + e515738 commit 62100bf
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ libltdl/
*.hex
*.pyc
*.pyo
# gcov output
*.gcno
*.gcda

# autoconf-preprocessed
Makefile
Expand Down
3 changes: 0 additions & 3 deletions doc/man1/flux-broker.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ Summarize available options.
*-v, --verbose*::
Be annoyingly chatty.

*-q, --quiet*::
Suppress messages intended for interactive users.

*-S, --setattr*='ATTR=VAL'::
Set initial value for broker attribute.

Expand Down
6 changes: 1 addition & 5 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ static const struct flux_handle_ops broker_handle_ops;

static int exit_rc = 0;

#define OPTIONS "+vqM:X:k:s:g:EIS:"
#define OPTIONS "+vM:X:k:s:g:EIS:"
static const struct option longopts[] = {
{"verbose", no_argument, 0, 'v'},
{"quiet", no_argument, 0, 'q'},
{"security", required_argument, 0, 's'},
{"module-path", required_argument, 0, 'X'},
{"k-ary", required_argument, 0, 'k'},
Expand All @@ -202,7 +201,6 @@ static void usage (void)
fprintf (stderr,
"Usage: flux-broker OPTIONS [initial-command ...]\n"
" -v,--verbose Be annoyingly verbose\n"
" -q,--quiet Be mysteriously taciturn\n"
" -X,--module-path PATH Set module search path (colon separated)\n"
" -s,--security=plain|curve|none Select security mode (default: curve)\n"
" -k,--k-ary K Wire up in a k-ary tree\n"
Expand Down Expand Up @@ -238,8 +236,6 @@ void parse_command_line_arguments(int argc, char *argv[],
case 'v': /* --verbose */
ctx->verbose = true;
break;
case 'q': /* --quiet */
break;
case 'X': /* --module-path PATH */
if (attr_set (ctx->attrs, "conf.module_path", optarg, true) < 0)
log_err_exit ("setting conf.module_path attribute");
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-start.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static struct optparse_option opts[] = {
.usage = "Set number of ranks in new instance", },
{ .name = "broker-opts",.key = 'o', .has_arg = 1, .arginfo = "OPTS",
.flags = OPTPARSE_OPT_AUTOSPLIT,
.usage = "Add comma-separated broker options, e.g. \"-o,-q\"", },
.usage = "Add comma-separated broker options, e.g. \"-o,-v\"", },
{ .name = "killer-timeout",.key = 'k', .has_arg = 1, .arginfo = "SECONDS",
.usage = "After a broker exits, kill other brokers after SECONDS", },
{ .name = "trace-pmi-server", .has_arg = 0, .arginfo = NULL,
Expand Down
2 changes: 1 addition & 1 deletion t/fluxometer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function fluxTest.init (...)
end

test.log_file = "lua-"..test.prog..".broker.log"
test.start_args = { "-o,-q,-Slog-filename=" .. test.log_file }
test.start_args = { "-o,-Slog-filename=" .. test.log_file }

local path = fluxTest.fluxbindir .. "/flux"
local mode = posix.stat (path, 'mode')
Expand Down
7 changes: 3 additions & 4 deletions t/sharness.d/flux-sharness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ test_under_flux() {
personality=${2:-full}
log_file="$TEST_NAME.broker.log"
if test -n "$TEST_UNDER_FLUX_ACTIVE" ; then
cleanup rm "${SHARNESS_TEST_DIRECTORY:-..}/$log_file"
test "$debug" = "t" || cleanup rm "${SHARNESS_TEST_DIRECTORY:-..}/$log_file"
flux_module_list > module-list.initial
cleanup check_module_list
return
fi
quiet="-o -q,-Slog-filename=${log_file},-Slog-forward-level=7"
if test "$verbose" = "t" -o -n "$FLUX_TESTS_DEBUG" ; then
flags="${flags} --verbose"
quiet=""
fi
if test "$debug" = "t" -o -n "$FLUX_TESTS_DEBUG" ; then
flags="${flags} --debug"
Expand Down Expand Up @@ -105,9 +103,10 @@ test_under_flux() {
unset FLUX_RC3_PATH
fi

logopts="-o -Slog-filename=${log_file},-Slog-forward-level=7"
TEST_UNDER_FLUX_ACTIVE=t \
TERM=${ORIGINAL_TERM} \
exec flux start --bootstrap=selfpmi --size=${size} ${quiet} ${timeout} \
exec flux start --bootstrap=selfpmi --size=${size} ${logopts} ${timeout} \
"sh $0 ${flags}"
}

Expand Down
4 changes: 2 additions & 2 deletions t/t0001-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ test_expect_success 'builtin test_size_large () works' '
test -n "$size" &&
size=$(FLUX_TEST_SIZE_MAX=2 test_size_large) &&
test "$size" = "2" &&
size=$(FLUX_TEST_SIZE_MIN=123 FLUX_TEST_SIZE_MAX=1000 test_size_large) &&
test "$size" = "123"
size=$(FLUX_TEST_SIZE_MIN=12345 FLUX_TEST_SIZE_MAX=23456 test_size_large) &&
test "$size" = "12345"
'

waitfile=${SHARNESS_TEST_SRCDIR}/scripts/waitfile.lua
Expand Down
14 changes: 12 additions & 2 deletions t/t2000-wreck.t
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,24 @@ test_expect_success 'flux-wreck: attach --label-io' '
test_expect_success 'wreck: attach --no-follow works' '
flux wreckrun -d -l -n4 sh -c "echo before; sleep 30; echo after" &&
test_when_finished flux wreck kill $(last_job_id) &&
run_timeout 5 flux wreck attach --no-follow $(last_job_id) >output.attach-n &&
cat >expected.attach-n <<-EOF &&
before
before
before
before
EOF
test_cmp expected.attach-n output.attach-n
i=0 &&
while test $i -lt 3; do
run_timeout 5 \
flux wreck attach --no-follow $(last_job_id) >output.attach-n
test_cmp expected.attach-n output.attach-n
rc=$?
if test $rc = 0; then break; fi
# retry
i=$((i+1))
sleep 0.1
done &&
test $rc -eq 0
'
test_expect_success 'wreck: dumplog works' '
test_must_fail flux wreckrun --input=bad.file hostname &&
Expand Down

0 comments on commit 62100bf

Please sign in to comment.