Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions distributed/cli/tests/test_dask_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,13 @@ def test_dashboard_port_zero(loop):
with popen(["dask-scheduler", "--dashboard-address", ":0"]) as proc:
count = 0
while count < 1:
line = proc.stderr.readline()
if b"dashboard" in line.lower():
line = proc.stderr.readline().decode("utf8")
if "dashboard" in line.lower():
sleep(0.01)
count += 1
assert b":0" not in line
# Remove timestamp from logging line which may contain ":0"
line = " - ".join(line.split(" - ")[1:])
assert ":0" not in line


PRELOAD_TEXT = """
Expand Down
2 changes: 1 addition & 1 deletion distributed/distributed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ distributed:

max-error-length: 10000 # Maximum size traceback after error to return
log-length: 10000 # default length of logs to keep in memory
log-format: '%(name)s - %(levelname)s - %(message)s'
log-format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
pdb-on-err: False # enter debug mode on scheduling error
system-monitor:
interval: 500ms
Expand Down
18 changes: 13 additions & 5 deletions distributed/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ def test_logging_default():
foreign_log = foreign_log.getvalue().splitlines()

# distributed log is configured at INFO level by default
assert distributed_log == [
expected_log_suffix = [
"distributed - INFO - 2: info",
"distributed.foo.bar - INFO - 3: info",
]
for result, expected_suffix in zip(distributed_log, expected_log_suffix):
assert result.endswith(expected_suffix)

# foreign logs should be unaffected by distributed's logging
# configuration. They get the default ERROR level from logging.
Expand Down Expand Up @@ -139,10 +141,13 @@ def test_logging_simple_under_distributed():

distributed_log = distributed_log.getvalue().splitlines()

assert distributed_log == [
expected_log_suffix = [
"distributed.foo - INFO - 1: info",
"distributed.foo.bar - ERROR - 3: error",
], (dask.config.config, distributed_log)
]

for result, expected_suffix in zip(distributed_log, expected_log_suffix):
assert result.endswith(expected_suffix), (dask.config.config, distributed_log)
"""

subprocess.check_call([sys.executable, "-c", code])
Expand Down Expand Up @@ -174,10 +179,13 @@ def test_logging_simple():

distributed_log = distributed_log.getvalue().splitlines()

assert distributed_log == [
expected_log_suffix = [
"distributed.foo - INFO - 1: info",
"distributed.foo.bar - ERROR - 3: error",
], (dask.config.config, distributed_log)
]

for result, expected_suffix in zip(distributed_log, expected_log_suffix):
assert result.endswith(expected_suffix), (dask.config.config, distributed_log)
"""

subprocess.check_call([sys.executable, "-c", code])
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ filterwarnings =
minversion = 4
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
asyncio: marks tests that test async functionality

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shouldn't be necessary.

avoid_ci: marks tests as flaky on CI on all OSs
ipython: marks tests as exercising IPython
timeout_method = thread
Expand Down