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

Allow daemonize in debug mode. #2475

Merged
merged 4 commits into from
Nov 14, 2017
Merged

Conversation

hjoliver
Copy link
Member

@hjoliver hjoliver commented Nov 7, 2017

Fixes a long-standing annoyance (for me anyway): --no-detach and --debug should be orthogonal.

@hjoliver hjoliver added this to the next release milestone Nov 7, 2017
@matthewrmshin
Copy link
Contributor

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

@hjoliver
Copy link
Member Author

hjoliver commented Nov 7, 2017

Thanks - I guess I missed that one!

@matthewrmshin
Copy link
Contributor

@oliver-sanders please sanity check.

Copy link
Member

@oliver-sanders oliver-sanders left a 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.

suite_pid = pid_str.rsplit("=", 1)[-1]
suite_port = server_str.rsplit(":", 1)[-1]
else:
if len(open(log_fname).readlines()) < 2:
Copy link
Member

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

Copy link
Member Author

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...

@hjoliver
Copy link
Member Author

@oliver-sanders - comment addressed

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants