Skip to content

Commit

Permalink
fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mischa committed Oct 28, 2023
1 parent 0e13ae8 commit f415a84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kcp2k/kcp2k.Tests/ClientServerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,33 +160,33 @@ void UpdateSeveralTimes(int amount)
void ConnectClientBlocking(string hostname = "127.0.0.1")
{
client.Connect(hostname, Port);
UpdateSeveralTimes(5);
UpdateSeveralTimes(10); // '5' causes flaky tests
}

// disconnect and give it enough time to handle
void DisconnectClientBlocking()
{
client.Disconnect();
UpdateSeveralTimes(5);
UpdateSeveralTimes(10); // '5' causes flaky tests
}

// kick and give it enough time to handle
void KickClientBlocking(int connectionId)
{
server.Disconnect(connectionId);
UpdateSeveralTimes(5);
UpdateSeveralTimes(10); // '5' causes flaky tests
}

void SendClientToServerBlocking(ArraySegment<byte> message, KcpChannel channel)
{
client.Send(message, channel);
UpdateSeveralTimes(10);
UpdateSeveralTimes(10); // '5' causes flaky tests
}

void SendServerToClientBlocking(int connectionId, ArraySegment<byte> message, KcpChannel channel)
{
server.Send(connectionId, message, channel);
UpdateSeveralTimes(10);
UpdateSeveralTimes(10); // '5' causes flaky tests
}

// tests ///////////////////////////////////////////////////////////////
Expand Down

0 comments on commit f415a84

Please sign in to comment.