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

WIP: add a "resilient" option to run all tests unconditionally #23589

Merged
merged 7 commits into from
Sep 21, 2017

Conversation

rfourquet
Copy link
Member

Previously, this was the default: even if one test fails, all
remaining tests are run nonetheless.
Now this requires to pass the "--resilient" option to "test/runtests.jl"
(or resilient=true to the runtest function); the new default
is to stop running tests as soon as possible when there is one failure.

The default was changed because of this comment to which I agree:

Having the test stops quickly makes debugging significantly easier.

But I don't know what the default should be for CIs nor how to pass them this new option.

I tried to even interrupt currently running tests with interrupt, but then I couldn't find a way to handle the exception gracefully (maybe JuliaLang/Distributed.jl#34?); but it seems good enough to just not run new tests after a failure.

DO NOT MERGE: this is based off of #23576 which should be merged first.

@rfourquet rfourquet added the testsystem The unit testing framework and Test stdlib label Sep 5, 2017

Run the Julia unit tests listed in `tests`, which can be either a string or an array of
strings, using `numcores` processors. (not exported)
strings, using `numcores` processors.
If one test fails, all remaining tests will be discarded, unless resilient is `true`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe state here explicitly that if resilient = true all remaining tests in other files will be run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, will clarify.

test/runtests.jl Outdated
@@ -59,14 +60,18 @@ cd(dirname(@__FILE__)) do
resp = [e]
end
push!(results, (test, resp))
if (isa(resp[end], Integer) && (resp[end] > max_worker_rss)) || isa(resp, Exception)
if resp[1] isa Exception
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry if this is stupid but why can't this be if resp[1] isa Exception && !resilient? Since the next condition is an elseif anyway?

Copy link
Member Author

@rfourquet rfourquet Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! If resp[1] isa Exception but resilient == true, then the condition in the elseif would be tested, which is invalid because then resp[end] == res[1] is an exception object which can't be compared as an Int.

@rfourquet
Copy link
Member Author

Thanks @kshyatt for reviewing!
Otherwise, someone has any comments about this new default of "early-exit-on-failure" concerning CI?

@rfourquet
Copy link
Member Author

@yuyichao what do you think of having "early-exit-on-failure" for CI?

@yuyichao
Copy link
Contributor

yuyichao commented Sep 7, 2017

I think this behavior (quit early) is useful for local testing. I don't really have an opinion which one is better for CI.
I would maybe keep the behavior the same on the CI unless there's a good reason to change it (I don't have one) but I'm fine either way.

@rfourquet
Copy link
Member Author

OK thanks. So I realize now that I can change the "runtests.jl" options in ".yml" files, except that I don't see one for "julia freebsd ci" (@ararslan any idea?). So I will keep this open a couple more days, and if no one makes a call, I will keep as default "early-exit" for local testing, and add the "--resilient" option for CI (status quo). I see one potential advantage of "early-exit" on CI: if there is one failure, free the resources for other jobs.

@ararslan
Copy link
Member

ararslan commented Sep 7, 2017

The FreeBSD CI bot is managed externally by @iblis17 rather than being locally configured via YAML files. Typically we just bug Iblis for FreeBSD configuration changes as needed.

Previously, this was the default: even if one test fails, all
remaining tests are run nonetheless.
Now this requires to pass the "--resilient" option to "test/runtests.jl"
(or `resilient=true` to the `runtest` function); the new default
is to stop running tests as soon as possible when there is one failure.
@rfourquet
Copy link
Member Author

@tkelman would you mind clarifying to what exactly you reacted with a downvote? Having "early-exit" by default locally, or on CI?

@tkelman
Copy link
Contributor

tkelman commented Sep 9, 2017

Neither. Not doing early exit was one of the major design goals of revising the test system and adding testsets in the first place. It can be an option but I don't think it should be default anywhere. Having to keep rerunning all tests to identify all the cases a change breaks isn't a good default.

@rfourquet
Copy link
Member Author

Ok I will change back the default then. Any suggestion for the name of the option? "quitearly", "shortcircuit", "fastexit"?

@KristofferC
Copy link
Sponsor Member

exit-on-error?

@rfourquet
Copy link
Member Author

So "exit-on-error" be it! It's nicely descriptive, if a bit verbose (so I added non-documented "--eoe" alias). One advantage of the earlier version is that there was a message proposing to use "--resilient" when some tests were skipped, making it more discoverable. But I'm fine with the new version, and will merge when CI turns green.


for (i, t) in enumerate(choices)
if t == "--skip"
skip_tests = choices[i + 1:end]
break
elseif t ∈ ["--exit-on-error", "--eoe"]
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, let's drop the --eoe short version.

@KristofferC
Copy link
Sponsor Member

Is this good to go now @rfourquet?

@rfourquet
Copy link
Member Author

Is this good to go now @rfourquet?

On my end it is!

@KristofferC KristofferC merged commit 896d599 into master Sep 21, 2017
@fredrikekre fredrikekre deleted the rf/runtests-resilient branch September 21, 2017 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants