-
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
Allow daemonize in debug mode. #2475
Conversation
7f5995d
to
df3c0e8
Compare
Need to make this change to get the failed test to pass: diff --git a/tests/events/suite/suite.rc b/tests/events/suite/suite.rc
index f44da3b29..f26e633c7 100644
--- a/tests/events/suite/suite.rc
+++ b/tests/events/suite/suite.rc
@@ -9,7 +9,7 @@
script = """
cylc reg $REG $DEF
echo "Sub-suite log file is: $PWD/$LOG"
-if cylc run --debug $REG > $LOG 2>&1; then
+if cylc run --no-detach --debug $REG > $LOG 2>&1; then
echo "ERROR: sub-suite did not abort as planned"
exit 1
else |
Thanks - I guess I missed that one! |
@oliver-sanders please sanity check. |
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.
One comment, otherwise fine.
lib/cylc/daemonize.py
Outdated
suite_pid = pid_str.rsplit("=", 1)[-1] | ||
suite_port = server_str.rsplit(":", 1)[-1] | ||
else: | ||
if len(open(log_fname).readlines()) < 2: |
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.
To avoid reading the entire log file we could do something like:
with open(log_fname) as log_f
try:
first_two_lines = next(log_f), next(log_f)
except StopIteration:
continue
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.
Good idea, will do that...
@oliver-sanders - comment addressed |
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.
Great.
Fix test breakages due to cylc/cylc-flow#2475
Fixes a long-standing annoyance (for me anyway):
--no-detach
and--debug
should be orthogonal.