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 stdout/err log errors introduced by PR #3347 #3379

Merged
merged 1 commit into from
Apr 22, 2024
Merged
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
6 changes: 5 additions & 1 deletion parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,12 @@ def log_std_stream(name: str, target) -> None:
logger.info(f"{name} for task {tid} will not be redirected.")
elif isinstance(target, str):
logger.info(f"{name} for task {tid} will be redirected to {target}")
elif isinstance(target, tuple) and len(target) == 2:
elif isinstance(target, os.PathLike):
logger.info(f"{name} for task {tid} will be redirected to {os.fspath(target)}")
elif isinstance(target, tuple) and len(target) == 2 and isinstance(target[0], str):
logger.info(f"{name} for task {tid} will be redirected to {target[0]} with mode {target[1]}")
elif isinstance(target, tuple) and len(target) == 2 and isinstance(target[0], os.PathLike):
logger.info(f"{name} for task {tid} will be redirected to {os.fspath(target[0])} with mode {target[1]}")
elif isinstance(target, DataFuture):
logger.info(f"{name} for task {tid} will staged to {target.file_obj.url}")
else:
Expand Down
6 changes: 5 additions & 1 deletion parsl/tests/test_monitoring/test_stdouterr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests monitoring records app name under various decoration patterns.
"""

import logging
import os
import parsl
import pytest
Expand Down Expand Up @@ -55,7 +56,7 @@ def can_stage_out(self, file):
(File("file:///tmp/pl5"), "file:///tmp/pl5"),
])
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
def test_stdstream_to_monitoring(stdx, expected_stdx, stream, tmpd_cwd):
def test_stdstream_to_monitoring(stdx, expected_stdx, stream, tmpd_cwd, caplog):
"""This tests that various forms of stdout/err specification are
represented in monitoring correctly. The stderr and stdout codepaths
are generally duplicated, rather than factorised, and so this test
Expand Down Expand Up @@ -106,3 +107,6 @@ def count_rows(table: str):
assert expected_stdx(c)
else:
raise RuntimeError("Bad expected_stdx value")

for record in caplog.records:
assert record.levelno < logging.ERROR
Loading