You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Christophe Le Saƫc <ch...@gmail.com> on 2023/01/05 13:00:20 UTC

Flaky test with TestNettyServer

Hello,

On my PRs, i have sometimes an error on TestNettyServer
<https://github.com/apache/avro/blob/master/lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java#L152>
unit test

Error:  org.apache.avro.ipc.netty.TestNettyServer.connectionsCount
Time elapsed: 0.008 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <2> but was: <3>

(*And it was before my merge with JUnit5*).

Often, i just have to make a new commit/push (just add or suppress an
empty line anywhere), and it can then run OK.

I think this could code from Netty server code, on
AbstractChannelHandlerContext
<https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java#L283>
that can call an executor to run it on "future". Unit test may be fix
for a majority of time by adding a Thread.sleep before checking
connectionsCount, but this not very clean. So, i wanted some advice
before fix it.

Regards,

Christophe.