bin: Fix race conditions in tests
authorSebastian Dröge <sebastian@centricular.com>
Tue, 21 Jun 2022 08:51:35 +0000 (11:51 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 21 Jun 2022 17:27:28 +0000 (17:27 +0000)
commite1e2d8d58c1e09e065849cdb1f6466c0537a7c51
tree26fa496fc16efe90bfbac61793f71b03a2724b4e
parentf0d4135b3a7ac6dd0b7a9b78787592aa5eb63b20
bin: Fix race conditions in tests

The latency messages are non-deterministic and can arrive before/after
async-done or during state-changes as they are posted by e.g. sinks from
their streaming thread but bins are finishing asynchronous state changes
from a secondary helper thread.

To solve this, expect latency messages at any time and assert that we
receive one at some point during the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2643>
subprojects/gstreamer/tests/check/gst/gstbin.c