diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-03-04 15:15:28 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-03-04 15:38:23 +0100 |
commit | 20c35f9a2b5fd970d43efc98c324e1e4c9dd153d (patch) | |
tree | 9d1f12f852b28daf73ab17e8753936e2a03485ea /tests | |
parent | 32cbd7556dfbf4deb20c704b8ac6a481ddd047ae (diff) |
Attempt to stabilize test_openDuringExitTransitionWithTimeout()
I was unable to reproduce the failure, but this patch should hopefully
make the test more resilient to timing issues by not requiring that the
popup's opened property is true, but rather that it was true at some
point.
Change-Id: Icbb0407683959b9fc01b3c0d66d632922363b5d9
Fixes: QTBUG-82643
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index adea23ef..6d45b09d 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -241,12 +241,19 @@ TestCase { function test_openDuringExitTransitionWithTimeout() { let control = createTemporaryObject(toolTipWithExitTransition, testCase, { timeout: 250 }) verify(control) + + let openedSpy = signalSpy.createObject(control, { target: control, signalName: "opened" }) + verify(openedSpy.valid) + control.open() verify(control.visible) // Can't be fully open yet because the enter transition has only just started. compare(control.opened, false) compare(control.enter.running, true) - tryCompare(control, "opened", true) + // Wait for it to have opened. We don't check that the opened property is still true + // because it can result in hard-to-reproduce flakiness. Instead we just check that + // it was opened at some point. + tryCompare(openedSpy, "count", 1) // Let it timeout and begin the exit transition. tryCompare(control, "opened", false) @@ -256,7 +263,7 @@ TestCase { // Quickly open it again; it should still timeout eventually. control.open() - tryCompare(control, "opened", true) + tryCompare(openedSpy, "count", 2) tryCompare(control.exit, "running", true) } |