-
Notifications
You must be signed in to change notification settings - Fork 94
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
Stop traceback when ParsecError
occurs during config load on workflow run
#4720
Conversation
8ccce2b
to
00d8732
Compare
Codecov upload and MacOS tests being particularly flaky today. Tests passing otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall happy
- Read PR
- Made a couple of comments about grammar &c, mostly reflecting dissatisfaction with my own previous work!
- Manually tested as many scenarios as I could think of
- Run tests locally
- Looked at testing of this change.
- I'm a little surprised that this change didn't affect
tests/unit/parsec/test_validate.py
, but I think it's probably a sign that the tests have been formatted to be robust against small changes to exception messages which I think is a good thing ™.
- I'm a little surprised that this change didn't affect
Add more specific info to error messages
eddf71b
to
5d7e1d9
Compare
Changes in response to Tim: https://github.com/cylc/cylc-flow/compare/eddf71b0b41a3d71dd1b8ef96fb8729512c2fcfe..5d7e1d9da1c90f7b50bb0c7ad08adf466014f1cd also viewable by clicking on "force pushed" above where it says
|
finally: | ||
yield caplog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the logic of moving the yield, feels wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(is it so you can do nasty things like setting up schedulers which are doomed to fail?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Otherwise you won't get the caplog yielded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you have a good point... this now breaks the teardown if an assertion fails in the test. Converted to draft while I explore a couple of solutions
Note to self: useful info: https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also ensure caplog instances always yielded
5d7e1d9
to
0416417
Compare
Test failures due to GH Actions flakiness 😒 |
try: | ||
self.load_flow_file() | ||
except ParsecError as exc: | ||
exc.schd_expected = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining what the exc.schd_expected
is about. Not so keen on the name schd_expected
but can't think of anything better.
Will push up a commit addressing your review comments after your response to my response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm going to try some manual testing, need to consider CylcConfigError too?
@MetRonnie waiting on |
E.g. try out diff --git a/cylc/flow/config.py b/cylc/flow/config.py
index 44e7b2a6e..7f8054e43 100644
--- a/cylc/flow/config.py
+++ b/cylc/flow/config.py
@@ -1958,6 +1958,8 @@ class WorkflowConfig:
def load_graph(self):
"""Parse and load dependency graph."""
+ from cylc.flow.exceptions import CylcConfigError
+ raise CylcConfigError("Moo")
LOG.debug("Parsing the dependency graph")
# Generate a map of *task* members of each family. followed by |
Ok, I'll resolve that comment then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works nicely, couldn't break it 👍.
Ah, I was looking at the wrong comment re:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with changes since last I looked.
These changes close #4216
ParsecError
s that occur during config load (either on workflow start or reload) no longer cause traceback, instead just giving a one line message, because we expect these to occur.ParsecError
s at any other time during workflow run are unexpected and still give traceback.Additionally, the Scheduler won't crash if a
ParsecError
occurs during reload (not sure if this was already fixed, but anyway it is fixed now for sure).Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.