| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Appveyor Qt sigint tests appear to be consistently failing due DLL loading
Relevant log portion__________________________ test_sigint[show-kwargs0] __________________________
[gw0] win32 -- Python 3.8.13 C:\Miniconda3-x64\envs\test-environment\python.exe
target = 'show', kwargs = {'block': True}
@pytest.mark.backend('QtAgg', skip_on_importerror=True)
@pytest.mark.parametrize("target, kwargs", [
('show', {'block': True}),
('pause', {'interval': 10})
])
def test_sigint(target, kwargs):
backend = plt.get_backend()
proc = WaitForStringPopen(
[sys.executable, "-c",
inspect.getsource(_test_sigint_impl) +
f"\n_test_sigint_impl({backend!r}, {target!r}, {kwargs!r})"])
try:
proc.wait_for('DRAW')
> stdout, _ = proc.communicate(timeout=_test_timeout)
lib\matplotlib\tests\test_backend_qt.py:130:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3-x64\envs\test-environment\lib\subprocess.py:1028: in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <matplotlib.tests.test_backend_qt.WaitForStringPopen object at 0x0000004E17E65CD0>
input = None, endtime = 526.437, orig_timeout = 60
def _communicate(self, input, endtime, orig_timeout):
# Start reader threads feeding into a list hanging off of this
# object, unless they've already been started.
if self.stdout and not hasattr(self, "_stdout_buff"):
self._stdout_buff = []
self.stdout_thread = \
threading.Thread(target=self._readerthread,
args=(self.stdout, self._stdout_buff))
self.stdout_thread.daemon = True
self.stdout_thread.start()
if self.stderr and not hasattr(self, "_stderr_buff"):
self._stderr_buff = []
self.stderr_thread = \
threading.Thread(target=self._readerthread,
args=(self.stderr, self._stderr_buff))
self.stderr_thread.daemon = True
self.stderr_thread.start()
if self.stdin:
self._stdin_write(input)
# Wait for the reader threads, or time out. If we time out, the
# threads remain reading and the fds left open in case the user
# calls communicate again.
if self.stdout is not None:
self.stdout_thread.join(self._remaining_time(endtime))
if self.stdout_thread.is_alive():
> raise TimeoutExpired(self.args, orig_timeout)
E subprocess.TimeoutExpired: Command '['C:\\Miniconda3-x64\\envs\\test-environment\\python.exe', '-c', "def _test_sigint_impl(backend, target_name, kwargs):\n import sys\n import matplotlib.pyplot as plt\n import os\n import threading\n\n plt.switch_backend(backend)\n from matplotlib.backends.qt_compat import QtCore # noqa\n\n def interrupter():\n if sys.platform == 'win32':\n import win32api\n win32api.GenerateConsoleCtrlEvent(0, 0)\n else:\n import signal\n os.kill(os.getpid(), signal.SIGINT)\n\n target = getattr(plt, target_name)\n timer = threading.Timer(1, interrupter)\n fig = plt.figure()\n fig.canvas.mpl_connect(\n 'draw_event',\n lambda *args: print('DRAW', flush=True)\n )\n fig.canvas.mpl_connect(\n 'draw_event',\n lambda *args: timer.start()\n )\n try:\n target(**kwargs)\n except KeyboardInterrupt:\n print('SUCCESS', flush=True)\n\n_test_sigint_impl('QtAgg', 'show', {'block': True})"]' timed out after 60 seconds
C:\Miniconda3-x64\envs\test-environment\lib\subprocess.py:1401: TimeoutExpired
----------------------------- Captured log setup ------------------------------
DEBUG matplotlib.pyplot:pyplot.py:316 Loaded backend QtAgg version 5.15.7.
---------------------------- Captured stderr call -----------------------------
Windows fatal exception: code 0xc0000139
Current thread 0x00000900 (most recent call first):
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1166 in create_module
File "<frozen importlib._bootstrap>", line 556 in module_from_spec
File "<frozen importlib._bootstrap>", line 657 in _load_unlocked
File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 991 in _find_and_load
File "<string>", line 12 in interrupter
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 1254 in run
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 932 in _bootstrap_inner
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 890 in _bootstrap
Thread 0x00000344 (most recent call first):
File "c:\projects\matplotlib\lib\matplotlib\backends\qt_compat.py", line 168 in _exec
File "c:\projects\matplotlib\lib\matplotlib\backends\backend_qt.py", line 1022 in mainloop
File "c:\projects\matplotlib\lib\matplotlib\backend_bases.py", line 3554 in show
File "c:\projects\matplotlib\lib\matplotlib\pyplot.py", line 421 in show
File "<string>", line 30 in _test_sigint_impl
File "<string>", line 34 in <module>
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 1254, in run
self.function(*self.args, **self.kwargs)
File "<string>", line 12, in interrupter
ImportError: DLL load failed while importing win32api: The specified procedure could not be found.
---------------------------- Captured log teardown ----------------------------
DEBUG matplotlib.pyplot:pyplot.py:316 Loaded backend agg version v2.2.
_________________________ test_sigint[pause-kwargs1] __________________________
[gw0] win32 -- Python 3.8.13 C:\Miniconda3-x64\envs\test-environment\python.exe
target = 'pause', kwargs = {'interval': 10}
@pytest.mark.backend('QtAgg', skip_on_importerror=True)
@pytest.mark.parametrize("target, kwargs", [
('show', {'block': True}),
('pause', {'interval': 10})
])
def test_sigint(target, kwargs):
backend = plt.get_backend()
proc = WaitForStringPopen(
[sys.executable, "-c",
inspect.getsource(_test_sigint_impl) +
f"\n_test_sigint_impl({backend!r}, {target!r}, {kwargs!r})"])
try:
proc.wait_for('DRAW')
stdout, _ = proc.communicate(timeout=_test_timeout)
except:
proc.kill()
stdout, _ = proc.communicate()
raise
print(stdout)
> assert 'SUCCESS' in stdout
E AssertionError: assert 'SUCCESS' in '\n'
lib\matplotlib\tests\test_backend_qt.py:136: AssertionError
----------------------------- Captured log setup ------------------------------
DEBUG matplotlib.pyplot:pyplot.py:316 Loaded backend QtAgg version 5.15.7.
---------------------------- Captured stdout call -----------------------------
---------------------------- Captured stderr call -----------------------------
Windows fatal exception: code 0xc0000139
Current thread 0x00000664 (most recent call first):
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1166 in create_module
File "<frozen importlib._bootstrap>", line 556 in module_from_spec
File "<frozen importlib._bootstrap>", line 657 in _load_unlocked
File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 991 in _find_and_load
File "<string>", line 12 in interrupter
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 1254 in run
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 932 in _bootstrap_inner
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 890 in _bootstrap
Thread 0x00000538 (most recent call first):
File "c:\projects\matplotlib\lib\matplotlib\backends\qt_compat.py", line 168 in _exec
File "c:\projects\matplotlib\lib\matplotlib\backends\backend_qt.py", line 408 in start_event_loop
File "c:\projects\matplotlib\lib\matplotlib\pyplot.py", line 557 in pause
File "<string>", line 30 in _test_sigint_impl
File "<string>", line 34 in <module>
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Miniconda3-x64\envs\test-environment\lib\threading.py", line 1254, in run
self.function(*self.args, **self.kwargs)
File "<string>", line 12, in interrupter
ImportError: DLL load failed while importing win32api: The specified procedure could not be found.
---------------------------- Captured log teardown ----------------------------
DEBUG matplotlib.pyplot:pyplot.py:316 Loaded backend agg version v2.2.
No response
| Back | FazBrowse Home | New Git URL |
Activity
ksunden commented on Nov 7, 2022
Full log: https://ci.appveyor.com/project/matplotlib/matplotlib/builds/45303213/job/p0makskomsa3rssy
tacaswell commented on Nov 7, 2022
Neither Qt or PyQt had releases on conda-forge in the last few days which was my first guess at what is going wrong.
Sorry I miss-read these logs on #24380 .
ksunden commented on Nov 7, 2022
https://www.appveyor.com/updates/2022/11/07/
Probably related to the appveyor platform updates that rolled out today
ksunden commented on Nov 7, 2022
Possibly also related:
matplotlib/.appveyor.yml
Lines 57 to 59 in 9f96205
Could be that the issue wasn't "pip vs conda", but rather some other factor... not sure what, though
ksunden commented on Nov 7, 2022
https://ci.appveyor.com/project/ksunden/appveyor-test/build/job/akqg7r4vfncf862d
Replicated with a stripped down version of the tests (didn't install mpl, but installed all requirements still)
ksunden commented on Nov 7, 2022
Okay, I know what is happening now:
Pywin32 released yesterday and so is on version 305 on pypi, but version 304 on conda forge
We attempt to install via conda because of the reasons indicated by the comment above. However, since the pypi version is higher, the conda install gets overridden with the PyPI version since pywin32 is specified in requirements/testing/extra.txt and it is installed with --upgrade
The pip version is broken for the conda install.
Our options are:
ksunden commented on Nov 7, 2022
Reordering works with the caveat that it still shows up as the pypi version in conda list, and so is likely to be confusing if anybody is looking at a similar problem in the future...
tacaswell commented on Nov 8, 2022
The mixing of conda and pip on CI is not great. Is it plausible to go pure conda on appveyor?
Another option is "does appveyor actually add coverage we do not get from azure + gha?" If not we should just drop the whole CI platform....
ksunden commented on Nov 8, 2022
We do get windows from azure (GHA is not currently configured for windows, could be added, but haven't looked at usage caps/simultaneous run caps or anything).
We do not have any other tests which use conda, if that is important to us. (in particular, conda can be a little slow when it comes to updating qt dependencies... I know over at pyqtgraph we made explicitly sure to work with the version of qt available via conda, and CI as much)
As for going full conda, no reason why it couldn't be done, just would be an additional place to update deps as it can't use the requirements txt files since package names are sometimes different.
timhoffm commented on Nov 8, 2022
We have an environment.yml. I think that could be used for appveyor.
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
2 remaining items
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda
Simplify appveyor to only use conda