mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 11:29:07 +08:00
[Core] test_advanced_3.py::test_logging_to_driver (round 2) (#9916)
This commit is contained in:
@@ -202,17 +202,21 @@ def test_logging_to_driver(shutdown_only):
|
||||
def f():
|
||||
# It's important to make sure that these print statements occur even
|
||||
# without calling sys.stdout.flush() and sys.stderr.flush().
|
||||
for i in range(100):
|
||||
print(i)
|
||||
print(100 + i, file=sys.stderr)
|
||||
for i in range(10):
|
||||
print(i, end=" ")
|
||||
print(100 + i, end=" ", file=sys.stderr)
|
||||
|
||||
captured = {}
|
||||
with CaptureOutputAndError(captured):
|
||||
ray.get(f.remote())
|
||||
time.sleep(1)
|
||||
|
||||
out_lines = captured["out"]
|
||||
err_lines = captured["err"]
|
||||
for i in range(200):
|
||||
for i in range(10):
|
||||
assert str(i) in out_lines
|
||||
|
||||
for i in range(100, 110):
|
||||
assert str(i) in err_lines
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user