After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758323 - tests: Fix spuriously failing netclientclock test on OSX
tests: Fix spuriously failing netclientclock test on OSX
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-19 10:11 UTC by Heinrich Fink
Modified: 2018-11-03 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Fix spuriously failing netclientclock test on OSX (3.66 KB, patch)
2015-11-19 10:11 UTC, Heinrich Fink
none Details | Review

Description Heinrich Fink 2015-11-19 10:11:01 UTC
On OSX, startup sync might take longer than what has been assumed in the test,
hence failing the test. OSX seems to be exposed to more OS scheduling jitter,
i.e. the observed RTTs take some time to be become stable enough.

As the comment in the original test says: 

"can't in general make a precise assertion here, because this depends on
system load and a lot of things. however within half a second they should
at least be within 1/10 of a second of each other... "

IMO, if we can't make a precise assertion here, we shouldn't make it at all in
the unit test. See attached patch for a fix.

Related to this, here is the debug output of one of the observations being
dropped (originally causing the longer sync time on OSX):

<netclientclock0> 
Dropping observation, long RTT 0:00:00.000977094 > 2 * avg 0:00:00.000182319

That shows that the RTT is of course very low (via localhost), but that this
observation is too far off the avg, likely because OS schedule jitter. slomo
(thanks for the analysis of the problem) suggested that maybe we can also
allow a higher deviation for RTTs lower than 1-2 ms. However, I am not
familiar enough with the netclientclock to write a patch for that/further
discuss if that makes sense or not. It would make the initial sync faster on
OSX in this case. Due to the dropped observations, sync can sometimes take
longer than 500ms on that platform. Does anybody have comments on that?

Anyway, IMO the test should be fixed nonetheless, patch is attached.
Comment 1 Heinrich Fink 2015-11-19 10:11:05 UTC
Created attachment 315876 [details] [review]
tests: Fix spuriously failing netclientclock test on OSX

On OSX, startup sync might take longer than what has been assumed in the
test, hence failing the test. OSX seems to be exposed to more OS
scheduling jitter, i.e. the observed RTTs take some time to be become
stable enough.

This patch first of all replaces the startup sync code in the test with
the new gst_clock_wait_for_sync API, and secondly, doesn't try to test
for startup sync to be fast. Instead we set some high timeout for sanity
reasons (10 seconds), and whenever the clock says it's ready, we check
(like before), if the server/client times are close enough. Lastly,
observed diff now uses GstClockTimeDiff and related macros for logging.
Comment 2 Jan Schmidt 2015-11-19 10:27:43 UTC
Higher deviation for low RTTs makes sense too
Comment 3 Heinrich Fink 2015-11-19 12:48:40 UTC
Ok, so in the example above, we'd have to use a factor of 6 to let the observation pass. How to configure the max deviation best?

Some suggestions:

(1) if RTT < 1 ms, always let it pass
(2) if RTT < 1 ms, use some other factor (8?)

What do you think?
Comment 4 GStreamer system administrator 2018-11-03 12:30:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/139.