Description
This test was merged 2 days ago from #2473 by @proneon267.
It's failing intermittently on GitHub Actions:
- https://github.com/beeware/toga/actions/runs/12153792178/
- https://github.com/beeware/toga/actions/runs/12142884949/attempts/1
But it's 100% reproducible locally for me:
% briefcase run --test -ur -- tests/window/test_window.py -k 'rapid'
...
[testbed] Starting test_suite...
===========================================================================
tests/window/test_window.py: Don't know how to open documents with extension .py
Waiting for app to be ready for testing... ready.
============================= test session starts ==============================
collecting ... collected 50 items / 46 deselected / 4 selected
tests/window/test_window.py::test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states0] PASSED [ 25%]
tests/window/test_window.py::test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states1] FAILED [ 50%]
tests/window/test_window.py::test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states2] PASSED [ 75%]
tests/window/test_window.py::test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states3] PASSED [100%]
=================================== FAILURES ===================================
_ test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states1] _
Traceback (most recent call last):
...
File "/Users/msmith/git/beeware/toga/testbed/build/testbed/macos/app/Toga Testbed.app/Contents/Resources/app/tests/window/test_window.py", line 812, in test_window_state_rapid_assignment
assert second_window_probe.instantaneous_state == states[-1]
AssertionError: assert <WindowState.NORMAL: 0> == <WindowState.MINIMIZED: 1>
+ where <WindowState.NORMAL: 0> = <tests_backend.window.WindowProbe object at 0x12c71adc0>.instantaneous_state
---------------------------- Captured stdout setup -----------------------------
Closing window
Resetting main_window
Window (Secondary Window) has been created
----------------------------- Captured stdout call -----------------------------
Secondary window is visible
Secondary window is in WindowState.MINIMIZED
=========================== short test summary info ============================
FAILED tests/window/test_window.py::test_window_state_rapid_assignment[MainWindow-second_window_kwargs0-states1] - assert <WindowState.NORMAL: 0> == <WindowState.MINIMIZED: 1>
+ where <WindowState.NORMAL: 0> = <tests_backend.window.WindowProbe object at 0x12c71adc0>.instantaneous_state
================= 1 failed, 3 passed, 46 deselected in 10.00s ==================
When the test runs, I get an error sound effect, the same one as if you press Cmd-C in the TextEdit app with nothing selected.