Skip to content
Open
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
3 changes: 3 additions & 0 deletions task-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ log_level = "INFO"
filterwarnings = [
"error::pytest.PytestCollectionWarning",
]
markers = [
"flaky: mark test as flaky and rerun on failure",
]
python_files = [
"test_*.py",
]
Expand Down
8 changes: 5 additions & 3 deletions task-sdk/tests/task_sdk/execution_time/test_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def subprocess_main():
]
)

@pytest.mark.flaky(reruns=3)
def test_reopen_log_fd(self, captured_logs, client_with_ti_start):
def subprocess_main():
# This is run in the subprocess!
Expand All @@ -360,11 +361,12 @@ def subprocess_main():

logs = comms.send(ResendLoggingFD())
assert isinstance(logs, SentFDs)
fd = os.fdopen(logs.fds[0], "w")
logging.root.info("Log on old socket")
json.dump({"level": "info", "event": "Log on new socket"}, fp=fd)
with os.fdopen(logs.fds[0], "w") as fd:
json.dump({"level": "info", "event": "Log on new socket"}, fp=fd)
fd.write("\n")

line = lineno() - 3 # Line the error should be on
line = lineno() - 5 # Line the error should be on

proc = ActivitySubprocess.start(
dag_rel_path=os.devnull,
Expand Down
Loading