Skip to content
  • Tim-Philipp Müller's avatar
    tests: multisocketsink: fix flaky unit test · 46aa4744
    Tim-Philipp Müller authored
    On slower systems, or under high system load (e.g. check-valgrind),
    the sending_buffers_with_9_gstmemories test would sometimes fail,
    because the read call only returns 32 bytes instead of the full
    36 bytes expected. This is because multisocketsink might end up
    doing a partial write of 32 bytes first, and then write the
    missing 4 bytes later, but since we don't wait for all of data
    to be written, there's a short window where our read call in the
    unit test might then only receive the 32 bytes written so far,
    which makes it deeply unhappy.
    
    Instead, make sure we loop to read all bytes.
    46aa4744