ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

`Text/input/GamepadAPI/gamepad-rumble.html` test is flaky

Open AtkinsSJ opened this issue 3 months ago • 8 comments

Seems to be in this exact way:

+++ /home/runner/_work/ladybird/ladybird/Tests/LibWeb/Text/expected/./GamepadAPI/gamepad-rumble.txt
@@ -40,6 +40,6 @@
 Trigger rumble promise resolved with 'complete'
 Testing preempting a rumble effect
 newDualRumbleResult: 'complete', preemptedResult: 'preempted'
-Received dual rumble effects: [{"lowFrequencyRumble":32767,"highFrequencyRumble":32767},{"lowFrequencyRumble":0,"highFrequencyRumble":0},{"lowFrequencyRumble":6553,"highFrequencyRumble":6553},{"lowFrequencyRumble":65535,"highFrequencyRumble":65535},{"lowFrequencyRumble":0,"highFrequencyRumble":0}]
+Received dual rumble effects: [{"lowFrequencyRumble":32767,"highFrequencyRumble":32767},{"lowFrequencyRumble":0,"highFrequencyRumble":0},{"lowFrequencyRumble":6553,"highFrequencyRumble":6553},{"lowFrequencyRumble":65535,"highFrequencyRumble":65535}]
 Received trigger rumble effects: [{"leftRumble":32767,"rightRumble":32767},{"leftRumble":0,"rightRumble":0}]
 Received gamepaddisconnected event for 'Ladybird Virtual Gamepad' at index 0

Disabled in #6301.

Tests/LibWeb/Text/input/GamepadAPI/gamepad-iframe.html also seems to time out sometimes, but less often than this fails.

cc: @Lubrsi

AtkinsSJ avatar Sep 25 '25 08:09 AtkinsSJ

Found a way to make the gamepad tests fail pretty reliably.

./Meta/ladybird.py run test-web -f gamepad -j 1

With all of them going through one thread and one WebContent, problems are always present.

To make them fail in different ways just add the shuffle option

./Meta/ladybird.py run test-web -f gamepad -j 1 -s

I'm guess the tests are not isolated from one another, and previously run tests are impacting later run tests.

rcorsi avatar Oct 23 '25 03:10 rcorsi

If I add Text/input/GamepadAPI/gamepad-is-available-in-new-navigables.html to the skip file Tests/LibWeb/TestConfig.ini it almost solves all the failures.

rcorsi avatar Oct 23 '25 03:10 rcorsi

Remaining faulting test is Text/input/GamepadAPI/gamepad-iframe.html which is timing out.

rcorsi avatar Oct 23 '25 03:10 rcorsi

Testing with this command ./Meta/ladybird.py run test-web -f gamepad -j 1 -v -v -v -s

And the Text/input/GamepadAPI/gamepad-rumble.html REMOVED from skipping in Text/input/input-file.html

So the Text/input/input-file.html has only these two gamepad entries.

Text/input/GamepadAPI/gamepad-is-available-in-new-navigables.html
Text/input/GamepadAPI/gamepad-iframe.html

I can't seem to cause any failures.

rcorsi avatar Oct 23 '25 03:10 rcorsi

Regarding gamepad-is-available-in-new-navigables.html it doesn't explicitly disconnect the gamepad at the end of the test. Don't know if that is a problem or not.

rcorsi avatar Oct 23 '25 03:10 rcorsi

Just did a 1000 test using the earlier setup

#! /bin/bash

for x in {1..1000}
do
    echo $x
    ./Meta/ladybird.py run test-web -f gamepad -j 1 -v -v -v -s
done

Got 5 failures in 1000 runs

      1 Fail: Text/input/GamepadAPI/gamepad-exposed-after-button-press.html
      4 Fail: Text/input/GamepadAPI/gamepad-rumble.html

rcorsi avatar Oct 23 '25 14:10 rcorsi

Put the gamepad-rumble back into the skip list and the results after 10000 runs

      2 Fail: Text/input/GamepadAPI/gamepad-exposed-after-button-press.html

      2 Pass: 6, Fail: 1, Skipped: 3, Timeout: 0, Crashed: 0
   9998 Pass: 7, Fail: 0, Skipped: 3, Timeout: 0, Crashed: 0

rcorsi avatar Oct 23 '25 22:10 rcorsi

Another gamepad-iframe.html issue, this time on macOS

https://github.com/LadybirdBrowser/ladybird/actions/runs/18842786543/job/53758972965?pr=6034

rcorsi avatar Oct 27 '25 14:10 rcorsi