beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.19k stars 655 forks source link

Correct flakiness in macOS CI #2637

Closed freakboy3742 closed 2 weeks ago

freakboy3742 commented 2 weeks ago

Corrects the intermittent failure seen in macOS CI with the test_secondary_window_with_content test.

The underlying cause of the crash appears to be an issue with removal of constraints; since the test involves the addition of content in a window and then rapidly deleting that window, it's at least conceptually consistent that the issue is related to ObjC reference counting on the very-short-lived window.

The problem can't be reproduced with 100% reliability, so it's difficult to confirm with 100% reliability that the problem has been resolved; but I've re-run the macOS x86-64 test multiple times with this fix in place, and it doesn't seem to be occurring any more.

This isn't a very satisfying fix - this sort of cleanup shouldn't be required; but until beeware/rubicon-objc#256 is addressed, I think it's about as good as we're going to get.

Also includes the "network fix" suggested in the discussion for #2632.

Fixes #2631. Fixes #2632.

PR Checklist:

rmartin16 commented 2 weeks ago

testbed linux...

tests/widgets/test_selection.py::test_item_titles Fatal Python error: Aborted

:(

freakboy3742 commented 2 weeks ago

testbed linux...

Dammit CI... can you hold it together for 30 minutes?

I guess there's another problem to resolve... that's the first time I've seen this one, though. For the purposes of this PR, I'll rerun and pretend it never happened... :-)