Page MenuHomePhabricator

ui_tests TestWindowsTerminalUnicode and TestWindowsTerminalUnicode are failing on Windows
Closed, ResolvedPublic

Description

Test are starting but two open processes never stops, the windows keeps open. It does not care whether the tests were startet via tests\ui_tests.bat or pwb ui_tests -v

C:\pwb\GIT\core>pip install pywinauto
Collecting pywinauto
  Using cached pywinauto-0.6.8-py2.py3-none-any.whl (362 kB)
Requirement already satisfied: six in c:\python39\lib\site-packages (from pywinauto) (1.15.0)
Requirement already satisfied: comtypes in c:\python39\lib\site-packages (from pywinauto) (1.1.10)
Requirement already satisfied: pywin32 in c:\python39\lib\site-packages (from pywinauto) (300)
Installing collected packages: pywinauto
Successfully installed pywinauto-0.6.8

C:\pwb\GIT\core>tests\ui_tests.bat -v
tests: max_retries reduced from 15 to 1
........................................ssssssEE
======================================================================
ERROR: setUpClass (__main__.TestWindowsTerminalUnicode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\ui_tests.py", line 576, in setUpClass
    cls.setUpProcess(['python', 'pwb.py', fn,
  File "C:\pwb\GIT\core\tests\ui_tests.py", line 498, in setUpProcess
    cls._app.connect_(process=cls._process.pid)
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1264, in __getattribute__
    return self[attr_name]
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1239, in __getitem__
    return self.window(best_match=key)
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1226, in window
    raise AppNotConnected("Please use start or connect before trying "
pywinauto.application.AppNotConnected: Please use start or connect before trying anything else

======================================================================
ERROR: setUpClass (__main__.TestWindowsTerminalUnicodeArguments)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\ui_tests.py", line 626, in setUpClass
    cls.setUpProcess(['cmd', '/k', 'echo off'])
  File "C:\pwb\GIT\core\tests\ui_tests.py", line 498, in setUpProcess
    cls._app.connect_(process=cls._process.pid)
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1264, in __getattribute__
    return self[attr_name]
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1239, in __getitem__
    return self.window(best_match=key)
  File "C:\Python39\lib\site-packages\pywinauto\application.py", line 1226, in window
    raise AppNotConnected("Please use start or connect before trying "
pywinauto.application.AppNotConnected: Please use start or connect before trying anything else

----------------------------------------------------------------------
Ran 46 tests in 0.347s

FAILED (errors=2, skipped=6)
C:\Python39\lib\subprocess.py:1048: ResourceWarning: subprocess 17512 is still running
C:\Python39\lib\subprocess.py:1048: ResourceWarning: subprocess 10552 is still running

C:\pwb\GIT\core>

Event Timeline

Xqt triaged this task as Medium priority.May 16 2021, 9:25 AM

Change 691931 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] Remove WindowsTerminalTests

https://gerrit.wikimedia.org/r/691931

The main issue seems solved when replacing connect_ by connect; however the tests then still fail, most likely because the font settings etc. in Windows 10 have changed significantly over where they were in Windows 7. Given that the code is largely 'battle-tested' and the tests cannot be run automatically indeed removing the tests seems like a reasonable approach.

Change 691931 merged by jenkins-bot:

[pywikibot/core@master] [tests] Remove WindowsTerminalTests

https://gerrit.wikimedia.org/r/691931

Xqt claimed this task.