Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional initial program timeout, for test scripts #1129

Merged
merged 2 commits into from Jul 26, 2017

Conversation

Projects
None yet
4 participants
@garlick
Copy link
Member

garlick commented Jul 26, 2017

Add an optional timeout on the initial program (rc2) - something @grondo and I were discussing this morning. The idea was that sharness test_under_flux might use this to make travis test hangs more easy to debug.

The timeout is set as an attribute. When the timeout expires, a SIGTERM is sent to the initial program. For example

$ ./flux start -o,-Sinit.rc2_timeout=0.1 sleep 1
2017-07-26T17:53:31.306006Z broker.err[0]: runlevel 2 timeout, sending SIGTERM
2017-07-26T17:53:31.306390Z broker.err[0]: Run level 2 Terminated (rc=143) 0.1s
$ echo $?
143

This is mainly useful for testing, or at least I didn't have another use case in mind as I wrote this.

garlick added some commits Jul 26, 2017

broker/runlevel: add runlevel timeout
If the attribute "init.rc2_timeout" is set to
a value in seconds greater than 0., the initial
program is sent a SIGTERM if it runs longer than that.
Example:

$ flux start -o,-Sinit.rc2_timeout=0.1 sleep 1
broker.err[0]: runlevel 2 timeout, sending SIGTERM
broker.err[0]: Run level 2 Terminated (rc=143) 0.1s
$ echo $?
143
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 26, 2017

Coverage Status

Coverage decreased (-0.05%) to 78.042% when pulling b69a21c on garlick:rc2_timeout into 5f48548 on flux-framework:master.

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jul 26, 2017

Codecov Report

Merging #1129 into master will decrease coverage by 0.07%.
The diff coverage is 85.71%.

@@            Coverage Diff            @@
##           master   #1129      +/-   ##
=========================================
- Coverage   77.67%   77.6%   -0.08%     
=========================================
  Files         184     184              
  Lines       31668   31696      +28     
=========================================
- Hits        24599   24598       -1     
- Misses       7069    7098      +29
Impacted Files Coverage Δ
src/broker/broker.c 73.12% <100%> (+0.02%) ⬆️
src/broker/runlevel.c 84.75% <85.18%> (+0.08%) ⬆️
src/common/libflux/handle.c 83.41% <0%> (-2.73%) ⬇️
src/common/libcompat/handle.c 84.7% <0%> (-2.59%) ⬇️
src/cmd/flux-event.c 67.74% <0%> (-1.08%) ⬇️
src/common/libflux/response.c 83.73% <0%> (-0.82%) ⬇️
src/broker/overlay.c 71.67% <0%> (-0.7%) ⬇️
src/modules/cron/cron.c 81.43% <0%> (-0.5%) ⬇️
src/bindings/lua/flux-lua.c 81.67% <0%> (-0.1%) ⬇️
src/common/libflux/message.c 81.17% <0%> (ø) ⬆️
... and 4 more
@grondo

This comment has been minimized.

Copy link
Contributor

grondo commented Jul 26, 2017

Nice! Let's merge this and I'll rebase in my branch and add a reasonable default timeout there for test_under_flux() and see what happens?

@garlick

This comment has been minimized.

Copy link
Member Author

garlick commented Jul 26, 2017

Works for me.

@grondo grondo merged commit e047dd4 into flux-framework:master Jul 26, 2017

4 checks passed

codecov/patch 85.71% of diff hit (target 77.67%)
Details
codecov/project Absolute coverage decreased by -0.07% but relative coverage increased by +8.03% compared to 5f48548
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.05%) to 78.042%
Details

@grondo grondo referenced this pull request Aug 23, 2017

Closed

0.8.0 Release #1160

@garlick garlick deleted the garlick:rc2_timeout branch Sep 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.