Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crazygao committed May 22, 2024
1 parent bec2ec2 commit c1b050d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def test_long_running_log(self, dev_connections, capsys):
executor = FlowExecutor.create(get_yaml_file("async_tools"), dev_connections)
executor.exec_line(self.get_line_inputs())
captured = capsys.readouterr()
expected_long_running_str_1 = r".*.*Task async_passthrough has been running for 1 seconds, stacktrace:\n.*async_passthrough\.py.*in passthrough_str_and_wait\n.*await asyncio.sleep\(1\).*tasks\.py.*" # noqa E501
expected_long_running_str_1 = r".*.*Task async_passthrough has been running for \d+ seconds, stacktrace:\n.*async_passthrough\.py.*in passthrough_str_and_wait\n.*await asyncio.sleep\(1\).*tasks\.py.*" # noqa E501
assert re.match(
expected_long_running_str_1, captured.out, re.DOTALL
), "flow_logger should contain long running async tool log"
expected_long_running_str_2 = r".*.*Task async_passthrough has been running for 2 seconds, stacktrace:\n.*async_passthrough\.py.*in passthrough_str_and_wait\n.*await asyncio.sleep\(1\).*tasks\.py.*" # noqa E501
expected_long_running_str_2 = r".*.*Task async_passthrough has been running for \d+ seconds, stacktrace:\n.*async_passthrough\.py.*in passthrough_str_and_wait\n.*await asyncio.sleep\(1\).*tasks\.py.*" # noqa E501
assert re.match(
expected_long_running_str_2, captured.out, re.DOTALL
), "flow_logger should contain long running async tool log"
Expand Down
4 changes: 4 additions & 0 deletions src/promptflow/tests/executor/e2etests/test_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def test_executor_logs(self, folder_name):
line_count = count_lines(bulk_run_log_path)
assert 40 <= line_count <= 50

import shutil

shutil.rmtree(logs_directory)

@pytest.mark.parametrize(
"flow_root_dir, flow_folder_name, line_number",
[[FLOW_ROOT, "print_input_flow", 8], [EAGER_FLOW_ROOT, "print_input_flex", 2]],
Expand Down

0 comments on commit c1b050d

Please sign in to comment.