TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.47k stars 2.57k forks source link

flaky failure solved #1297

Closed Alisha-0321 closed 1 year ago

Alisha-0321 commented 1 year ago

The flaky test failure is resolved with my fixes. I run the test 10,000 times, and every time the test passes.

Description

try { Thread.sleep(100); } catch (InterruptedException e) { System.out.println("Exception"); }

Related Issue

https://github.com/TooTallNate/Java-WebSocket/issues/1296

Motivation and Context

This removes the test failures.

How Has This Been Tested?

With my solution, I run the test 10,000 times with the following command, and the test has never failed. mvn test -Dtest=org.java_websocket.issues.Issue580Test#runNoCloseBlockingTestScenario[7]

Types of changes

Checklist:

marci4 commented 1 year ago

We cannot simple sleep in the main code