-
Notifications
You must be signed in to change notification settings - Fork 212
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
Errors in system test's __init__ method not reported correctly #390
Comments
Good catch. |
@jgfouca : you probably have some thoughts on how to fix this, but I'll share the somewhat naive possible ideas that came into my head during my walk home:
Of course, some of these may not work, and you should feel free to ignore these if you have your own thoughts :-) |
Looking more closely at this, it's hard to see a good solution. My opinion is that an exception escaping from a test constructor is a programming error, so don't expect things to be in a consistent state. The core problem is that, at the time of construction, the Test object does not know which phase is about to be run, so a preemptive FAIL is impossible. Even if it weren't, a preemptive FAIL would not be safe because any instances of wait_for_tests waiting on that test would interpret that as a completed test. |
…t_throw Exceptions in SystemTest constructors should leave TestStatus in decent state Also, 1) Added regression tests to test the above 2) case_setup should not put stuff in TestStatus unless it's a test case 3) Rename some acme_* things to cime_* Test suite: scripts_regresssion_test Test baseline: Test namelist changes: Test status: bit for bit Fixes #390 User interface changes?: Minor Code review: @billsacks @jedwards4b
I noticed that, if I raise an exception in the init method of a system test, the test gets reported as a PASS.
Example:
Then
./create_test --test-root . SMS.f10_f10.ICLM45.yellowstone_gnu
Results in:
But TestStatus has:
and running cs.status gives:
I am particularly thinking about this with respect to the clone-based test infrastructure: I have set this up to do all test-specific setup from the constructor. If there's no way to address this issue (and thus errors in the constructor will lead to tests looking like they have passed), then I should probably move this test-specific setup into the build_phase method instead. But it seems like it's worth addressing this issue for more general reasons, if possible.
The text was updated successfully, but these errors were encountered: