Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[GOAL2-784] Fix random network unit test failures #75
Our existing websocket library would fail to flush the first few messages, as long as the messages accumulated size is below 4096 bytes.
The websocket library is creating a thread that is responsible for flushing the pending buffer content. When a write operation is complete, the flushing thread is being woken up to flush the buffer content.
In the context of our unit tests, where we send two small messages and wait until they reach the other socket, it being expressed as a flaky test.
The first for this is pretty straight forward; on the flushing thread, just flush the content of the buffer upon startup without waiting for a signal. Then, wait for the signal which would handle the subsequent iteration.