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

Fix test_logging_to_driver and test_not_logging_to_driver #5462

Merged
merged 2 commits into from
Aug 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions python/ray/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2649,8 +2649,11 @@ def f():
output_lines = captured["out"]
for i in range(200):
assert str(i) in output_lines
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unrelated to the test failure, but in this test we should really be checking that we don't get any unintended log messages (or duplicates). Especially since @stephanie-wang saw some duplicates recently.

error_lines = captured["err"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we remove this check, then we should include a comment that explains what goes wrong if we do check it. Since people (myself included) will be very tempted to bring back this check.

assert len(error_lines) == 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me realize that this line should have been

     assert len(error_lines) == 0, error_lines

so that we can what the stderr was in the case of error


# TODO(rkn): Check that no additional logs appear beyond what we expect
# and that there are no duplicate logs. Once we address the issue
# described in https://github.com/ray-project/ray/pull/5462, we should
# also check that nothing is logged to stderr.


def test_not_logging_to_driver(shutdown_only):
Expand All @@ -2671,8 +2674,11 @@ def f():

output_lines = captured["out"]
assert len(output_lines) == 0
error_lines = captured["err"]
assert len(error_lines) == 0

# TODO(rkn): Check that no additional logs appear beyond what we expect
# and that there are no duplicate logs. Once we address the issue
# described in https://github.com/ray-project/ray/pull/5462, we should
# also check that nothing is logged to stderr.


@pytest.mark.skipif(
Expand Down