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

PR: Use pytest-timeout and set timeout to 120 secs #17990

Merged
merged 1 commit into from
Jul 2, 2022

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented May 23, 2022

Description of Changes

Issue(s) Resolved

Fixes #17815

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz changed the base branch from master to 5.x May 23, 2022 19:08
@dalthviz dalthviz changed the title Tests: Use pytest-timeout and set timeout to 120 secs [WIP] PR: Use pytest-timeout and set timeout to 120 secs May 23, 2022
@dalthviz dalthviz self-assigned this May 23, 2022
@dalthviz dalthviz added this to the v5.3.2 milestone May 23, 2022
@dalthviz dalthviz force-pushed the pytest-timeout branch 2 times, most recently from cccd04b to c315914 Compare June 20, 2022 15:54
@dalthviz dalthviz changed the title [WIP] PR: Use pytest-timeout and set timeout to 120 secs PR: Use pytest-timeout and set timeout to 120 secs Jun 20, 2022
@dalthviz dalthviz requested a review from ccordoba12 June 20, 2022 16:11
@dalthviz
Copy link
Member Author

Note: Checked on Windows putting a time.sleep and the test suite exited with the timeout related traceback:

spyder/plugins/editor/widgets/tests/test_completions_hide.py::test_automatic_completions_hide_complete PASSED [ 50%]
spyder/plugins/editor/widgets/tests/test_completions_hide.py::test_automatic_completions_widget_visible
+++++++++++++++++++++++++++++++++++++ Timeout +++++++++++++++++++++++++++++++++++++

~~~~~~~~~~~~~~~~~~~~~~~~~~~ Stack of MainThread (2848) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  File "E:\Acer\Documentos\Spyder\spyder\runtests.py", line 73, in <module>
    main()
  File "E:\Acer\Documentos\Spyder\spyder\runtests.py", line 69, in main
    run_pytest(run_slow=test_args.run_slow, extra_args=pytest_args)
  File "E:\Acer\Documentos\Spyder\spyder\runtests.py", line 52, in run_pytest
    errno = pytest.main(pytest_args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\config\__init__.py", line 164, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\main.py", line 315, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\main.py", line 268, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\main.py", line 322, in _main
    config.hook.pytest_runtestloop(session=session)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\main.py", line 347, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\flaky\flaky_pytest_plugin.py", line 94, in pytest_runtest_protocol
    self.runner.pytest_runtest_protocol(item, nextitem)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 111, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 130, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\flaky\flaky_pytest_plugin.py", line 138, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 258, in call_runtest_hook
    return CallInfo.from_call(
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 338, in from_call
    result: Optional[TResult] = func()
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 259, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\runner.py", line 166, in pytest_runtest_call
    item.runtest()
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\python.py", line 1761, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\_pytest\python.py", line 192, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "E:\Acer\Documentos\Spyder\spyder\spyder\plugins\editor\widgets\tests\test_completions_hide.py", line 120, in test_automatic_completions_widget_visible
    time.sleep(120)

+++++++++++++++++++++++++++++++++++++ Timeout +++++++++++++++++++++++++++++++++++++

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Tested on Linux and works as expected. Thanks @dalthviz!

@ccordoba12 ccordoba12 merged commit 75f3fd8 into spyder-ide:5.x Jul 2, 2022
ccordoba12 added a commit that referenced this pull request Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants