Skip to content

Mostly fix NetworkTest#357

Merged
ix0rai merged 11 commits intoQuiltMC:develop/2.8from
supersaiyansubtlety:fix-NetworkTest-busy-wait
Jan 21, 2026
Merged

Mostly fix NetworkTest#357
ix0rai merged 11 commits intoQuiltMC:develop/2.8from
supersaiyansubtlety:fix-NetworkTest-busy-wait

Conversation

@supersaiyansubtlety
Copy link
Member

@supersaiyansubtlety supersaiyansubtlety commented Dec 25, 2025

Mostly fixes NetworkTest flakiness.

Merry happy.


  • waits for client connection in testLogin and testTakenUsername to avoid race conditions
  • removes unnecessary EnigmaClient::disconnect calls after waiting on DummyClientPacketHandler.disconnectFromServerLatch
  • kicks clients instead of directly disconnecting them when not waiting on the disconnection latch;
    fixes race condition where the kick calls of servers' client threads sent packets that were received by other tests' clients
  • adds repetitions to most tests

Warning

testTakenUsername is still flaky on CI

I didn't add repetitions for testTakenUsername because it's still flaky on CI; I can't reproduce the failures locally.

I thought the issue might be that the build workflow runs on jdk 17+20 were interfering with each other, but it's still flaky when they're sequential (10,000 reps here):

…tLogin; fixes race condition causing testLogin flakiness

tests that wait on DummyClientPacketHandler#disconnectFromServerLatch are still flaky: NetworkTest::connectClient can throw BindException
…cketHandler#disconnectFromServerLatch waits

replace NetworkTest::testTakenUsername's client1 diconnect call with kickAfterTest
repeat each test 100 times (except testUnapprovedMessage which takes 3 sec. per success)
warn about over-repeating tests that wait on DummyClientPacketHandler#disconnectFromServerLatch
@supersaiyansubtlety supersaiyansubtlety self-assigned this Dec 25, 2025
@supersaiyansubtlety supersaiyansubtlety added bug Something isn't working server affects the enigma server test changes or additions to the test suite labels Dec 25, 2025
@ix0rai ix0rai self-requested a review January 16, 2026 17:04
Copy link
Member

@ix0rai ix0rai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! excited to not be dealing with this on the ci literally every other second

@ix0rai ix0rai merged commit e2b99d5 into QuiltMC:develop/2.8 Jan 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server affects the enigma server test changes or additions to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants