Skip to content

Commit

Permalink
Merge pull request #1125 from grondo/chain-lint
Browse files Browse the repository at this point in the history
Fix testsuite --chain-lint option, add timeout to some tests, and other testing fixes
  • Loading branch information
garlick authored Aug 2, 2017
2 parents ae10412 + 6ce23ce commit 71b40ff
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ after_failure:
- find . -name *.broker.log | xargs -i sh -c 'printf "\033[31mFound {}\033[39m\n";cat {}'
- src/test/backtrace-all.sh
- cat config.log
# Issue #997 debugging
- cat src/common/libflux/test_reactor.log

before_deploy:
# Get anchor (formatted properly) and base URI for latest tag in NEWS file
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ coverage:
round: down
range: "50...100"
ignore:
- ".*/t/.*"
- "t/.*"
- ".*/test/.*"
- ".*/tests/.*"
- ".*/man3/*.c"
Expand Down
9 changes: 9 additions & 0 deletions src/common/libflux/test/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,19 @@ void test_curve (void)
unlink_recursive (path);
}

void alarm_callback (int arg)
{
diag ("test timed out");
exit (1);
}

int main (int argc, char *argv[])
{
plan (NO_PLAN);

signal (SIGALRM, alarm_callback);
alarm (30);

test_ctor_dtor ();
test_keygen ();
test_munge ();
Expand Down
13 changes: 12 additions & 1 deletion t/sharness.d/flux-sharness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@ test_under_flux() {
if test "$debug" = "t" -o -n "$FLUX_TESTS_DEBUG" ; then
flags="${flags} --debug"
fi
if test "$chain_lint" = "t"; then
flags="${flags} --chain-lint"
fi
if test -n "$logfile" -o -n "$FLUX_TESTS_LOGFILE" ; then
flags="${flags} --logfile"
fi
if test -n "$SHARNESS_TEST_DIRECTORY"; then
cd $SHARNESS_TEST_DIRECTORY
fi
timeout="-o -Sinit.rc2_timeout=300"
if test -n "$FLUX_TEST_DISABLE_TIMEOUT"; then
timeout=""
fi

if test "$personality" = "minimal"; then
export FLUX_RC1_PATH=""
Expand All @@ -67,7 +74,8 @@ test_under_flux() {

TEST_UNDER_FLUX_ACTIVE=t \
TERM=${ORIGINAL_TERM} \
exec flux start --bootstrap=selfpmi --size=${size} ${quiet} "sh $0 ${flags}"
exec flux start --bootstrap=selfpmi --size=${size} ${quiet} ${timeout} \
"sh $0 ${flags}"
}

mock_bootstrap_instance() {
Expand Down Expand Up @@ -99,4 +107,7 @@ if ! lua -e 'require "posix"'; then
error "failed to find lua posix module in path"
fi

# Some tests in flux don't work with --chain-lint, add a prereq for
# --no-chain-lint:
test "$chain_lint" = "t" || test_set_prereq NO_CHAIN_LINT
# vi: ts=4 sw=4 expandtab
1 change: 1 addition & 0 deletions t/t0016-cron-faketime.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if test "$t" != "123456789" ; then
fi

SIZE=1
export FLUX_TEST_DISABLE_TIMEOUT=t
export LD_PRELOAD=libfaketimeMT.so.1
export FAKETIME_NO_CACHE=1
export FAKETIME_TIMESTAMP_FILE=$(pwd)/faketimerc
Expand Down

0 comments on commit 71b40ff

Please sign in to comment.