Skip to content

Conversation

@java-codehunger
Copy link

@java-codehunger java-codehunger commented Mar 30, 2023

Description

This test is flakily fails. I run this test many times and it makes assertion fails.

Related Issue

I was running this test many times and it fails. The failure message is.

Failure:
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at org.java_websocket.issues.Issue997Test.test_localServer_ServerLocalhost_ClientLocalhost_CheckInactive(Issue997Test.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:750)

Results :

Failed tests: test_localServer_ServerLocalhost_ClientLocalhost_CheckInactive(org.java_websocket.issues.Issue997Test)

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Motivation and Context

It will reduce the chances of flaky failure.

How Has This Been Tested?

I run the test in Ubuntu 20 with JDK both 8 and 11.

Types of changes

  • I simply add a little wait time before the assertion checking.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@marci4
Copy link
Collaborator

marci4 commented Jan 1, 2025

Duplicate of #1450

@marci4 marci4 marked this as a duplicate of #1450 Jan 1, 2025
@marci4 marci4 closed this Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants