1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 08:03:21 +08:00
osu-lazer/osu.Game.Tests/Visual
Bartłomiej Dach 15fb1a099e Modify assert to avoid false failures
In headless tests it was possible for TestInstantLoad() to erroneously
fail. There were two scenarios in which LoadingSpinner could be null:

1. If the test runner was quick enough, the assert could end up running
   even before Loader.OnEntering() had even had a chance to, meaning
   that the spinner was never even actually assigned to or instantiated
   at that point in time.

2. Even if Loader.OnEntering() had managed to run, there was also
   a possibility that the spinner itself wasn't loaded at the point
   of checking the assertion. As the spinner is accessed through
   ChildrenOfType(), which only checks InternalChildren and ignores
   all currently-loading drawables, it would therefore return null.

As null != 0, both of these cases would actually fail the test (this is
best seen running headless, preferably with a [Repeat] attribute
attached).

To resolve, allow the spinner to be null at the point of asserting and
duplicate the assertion step at the end. This weakens the test, as case
(1) should probably be waited for and case (2) could be solved with
exposition as protected in the base, but when attempting to wait for
the loader itself to be loaded there were also cases where the
appropriate until step would take so much time that the spinner would
actually become visible in line with the delayed display logic, so this
is a best-effort attempt to address both points without radical
changes.
2020-03-28 00:43:57 +01:00
..
Background Merge branch 'master' into fix-carousel-root-selects-from-nothing 2020-03-23 11:15:22 +09:00
Components Rename base test class to help avoid incorrect reference 2020-03-23 10:01:33 +09:00
Editor Rename base test class to help avoid incorrect reference 2020-03-23 10:01:33 +09:00
Gameplay Merge pull request #8455 from Game4all/handle-novideo-beatmaps 2020-03-27 21:12:40 +09:00
Menus Modify assert to avoid false failures 2020-03-28 00:43:57 +01:00
Multiplayer Rename base test class to help avoid incorrect reference 2020-03-23 10:01:33 +09:00
Navigation Rename base test class to help avoid incorrect reference 2020-03-23 10:01:33 +09:00
Online Add tests to cover the issue 2020-03-25 20:58:51 +03:00
Ranking Show 'D' rank badge on accuracy circle 2020-03-19 11:58:52 +09:00
Settings Add tests 2019-12-06 18:04:46 +09:00
SongSelect Merge branch 'master' into fix-carousel-root-selects-from-nothing 2020-03-23 11:34:04 +09:00
UserInterface Merge branch 'master' into friends-layout-split 2020-03-23 15:36:04 +09:00
TestSceneOsuGame.cs CA2201: throw correct exception type. 2019-12-17 13:00:02 +08:00
TestSceneOsuScreenStack.cs Fix song select filters not reapplied if in a child screen 2019-12-10 02:30:23 +09:00