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

hanging when I use --time-methid=signal #173

Open
bailuan opened this issue May 30, 2024 · 0 comments
Open

hanging when I use --time-methid=signal #173

bailuan opened this issue May 30, 2024 · 0 comments

Comments

@bailuan
Copy link

bailuan commented May 30, 2024

i am making a unittest,
`for index, test_case in enumerate(test_cases[start_case_index:], start=start_case_index):
test_case_name = test_case.split("::")[-1]
print(f"Running {test_case_name}")

    pytest.main(['-v', '--tb=short', '--capture=no', '--timeout=20', '--timeout-method=signal', test_case], plugins=[recorder])
    
    result_data = recorder.results.get(test_case)
    if result_data is None:
        result_data = {
            "outcome": "not executed",
            "duration": 0,
            "timestamp": datetime.now().isoformat()
        }`

above is my test code, if one case is out of time, the process will hang and show log like below and would not break out to next test case,what shoukd I do?
++++++++++++++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++++++++++++

  File "/usr/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 83, in _worker
    work_item.run()
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 461, in thread_task
    result = run_test(fn, inputs, output_num, global_config_path,
  File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 428, in run_test
    output_fns1 = run_in_backend("dlc")
  File "/workspace/bailuan/20240105_iree_chiptech/iree/tests/e2e/dlc_specific/test_runner.py", line 406, in run_in_backend
    run_result = subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 505, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1154, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.10/subprocess.py", line 2021, in _communicate
    ready = selector.select(timeout)
  File "/usr/lib/python3.10/selectors.py", line 416, in select
    fd_event_list = self._selector.poll(timeout)
++++++++++++++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++++++++++++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant