Bug 196198

Summary: [GTK] Unexpected timeout in http/tests/media/video-play-stall-seek.html
Product: WebKit Reporter: Diego Pino <dpino>
Component: New BugsAssignee: Enrique Ocaña <eocanha>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cgarcia, eocanha, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, lmoura, menard, philipj, pnormand, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Diego Pino 2019-03-25 03:29:18 PDT
The test started to time out since r243058 ([GStreamer] Rewrite HTTP source element using pushsrc base class https://bugs.webkit.org/show_bug.cgi?id=195631)
Comment 1 Philippe Normand 2019-03-26 05:03:57 PDT
I suspect it's just slow now, not timing out. So probably a better expectation would be "Slow".
Comment 2 Diego Pino 2020-04-11 01:07:43 PDT
I run the test individually several times and every time it took more than 75 seconds. So it seems the test is actually timing out.
Comment 3 Diego Pino 2020-04-11 01:10:55 PDT
Sometimes the test passes, but most of the times out or fails.
Comment 4 Diego Pino 2020-04-11 01:13:07 PDT
I'm going to change the test to Slow anyway to see if that helps to get more passes. Sorry for the noise.
Comment 5 Lauro Moura 2020-04-12 11:48:24 PDT
Link to results archive: https://results.webkit.org/?platform=GTK&platform=WPE&suite=layout-tests&test=http%2Ftests%2Fmedia%2Fvideo-play-stall-seek.html

Still timing out most times. When it passes, the run time is <= 3s, so this does not look like a Slow test.

Also, it is only passing in X11 Release. Always Timeout or Fail in Debug or Wayland.

I will update the test expectations.
Comment 6 Enrique Ocaña 2021-05-27 11:08:36 PDT
I've ran this test in X11 Release and the test doesn't timeout (Lauro already mentioned this), but fails.

The test is making a request of a media file to the load-and-stall.cgi, which serves part of the file and then stalls on purpose. At some point a seek back to 0 is done and the test expects the readyState >= HAVE_CURRENT_DATA (meaning "part of the video is loaded, including position 0", which is true) and networkState == NETWORK_LOADING (the loading still hasn't finished, this isn't always true, as sometimes it's NETWORK_IDLE).

Debugged why the last condition isn't met and found that CachedResourceStreamingClient::loadFinished() is called (the download is declared to be finished forever because 0 bytes have been read). I went down through the layers down to the IPC that listens the NetworkProcess messages, continued in the NetworkProcess and found that g_input_stream_read_async() was returning 0 bytes because libsoup just behaves that way (or that's whay I could understand with my limited knowledge of libsoup). If no bytes are available immediately, then 0 bytes are returned and the upper layers just assume EOS.

With this in mind, I think the test should be changed and just avoid the networkState check. I don't think anybody would care much, since the test is skipped on win, glib, gtk-wayland and mac (nobody uses it?).
Comment 7 Philippe Normand 2021-05-28 04:13:38 PDT
It still times out on the bots, sometimes fails, but mostly just times out.

If you overload your build machine with, say, a debug build running in another terminal, is the test now timing out?
Comment 8 Enrique Ocaña 2021-05-28 04:40:32 PDT
All my previous comments were about the test failing because of the networkState condition being false, without timeout. Now I've also been able to reproduced sometimes an initial timeout caused by the "waiting" event not being even emitted (a second time, what the test expects) when the video starts. I'm debugging that now.
Comment 9 Enrique Ocaña 2021-06-08 10:56:02 PDT
Created attachment 430863 [details]
Patch
Comment 10 Enrique Ocaña 2021-06-10 05:16:51 PDT
Created attachment 431064 [details]
Patch
Comment 11 Enrique Ocaña 2021-06-10 05:44:30 PDT
Comment on attachment 431064 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431064&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:457
> +        GST_DEBUG_OBJECT(pipeline(), "Setting high-percent=0 on GstDownloadBuffer to force 100% buffered reporting");

I forgot to use %% here to escape the percent sign.
Comment 12 Philippe Normand 2021-06-14 08:46:46 PDT
Comment on attachment 431064 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431064&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:491
> +    bool m_isWebKitWebSrcHasEos { false };

Two verbs in this variable name ? Maybe one is enough :) What about m_hasWebKitWebSrcSentEOS ?
Comment 13 Enrique Ocaña 2021-06-15 09:07:40 PDT
Comment on attachment 431064 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=431064&action=review

>> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:491
>> +    bool m_isWebKitWebSrcHasEos { false };
> 
> Two verbs in this variable name ? Maybe one is enough :) What about m_hasWebKitWebSrcSentEOS ?

Sounds good, I'm changing it.
Comment 14 Enrique Ocaña 2021-06-15 09:11:05 PDT
Created attachment 431446 [details]
Patch
Comment 15 EWS 2021-06-17 08:58:07 PDT
Committed r278988 (238914@main): <https://commits.webkit.org/238914@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431446 [details].
Comment 16 Radar WebKit Bug Importer 2021-06-17 08:59:30 PDT
<rdar://problem/79453713>