wait_vanish does nothing
I have already fixed this (!1467 (merged)), this issue is just for Sponsor11 tracking. It's best explained by the commit itself:
commit 3ec590aed35e84ac4e15f07fc4d3ea2671a4d8f9 (origin/make-find-not-wait, make-find-not-wait)
Author: anonym <anonym@riseup.net>
Date: Thu Mar 28 12:36:53 2024 +0100
Test suite: fix wait_vanish()
Since try_for() considers an iteration a success (and returns) as long
as the block returns something true-ish (i.e. everything but false and
nil) we used to return from the try_for() when finding a match, since
that becomes the block's return value and is true-ish, which is the
opposite of what we want.
We can observe this in this debug log where I temporarily enabled
debug logging (which we explicitly disable) for find() and try_for()
so we can see more clearly what happens:
Screen: waiting for TorBrowserStopButton.png to vanish
try_for: attempt 1 (0.01s elapsed of 120s)...
Screen: trying to find TorBrowserStopButton.png
Screen[match_screen]: taking screenshot
Screen[match_screen]: matching template to screenshot
OpenCV: starting opencv_match_template.py
Screen: found TorBrowserStopButton.png at (96, 97)
try_for: success!
Screen: TorBrowserStopButton.png has vanished
Whoops! So this method has been doing nothing except block execution
until it returns, which I guess has been enough in most cases it's
used, but this fix will probably fix some fragile tests.