openlcb / OpenLCB_Java

A git-managed copy of the SVN-based Java prototype implementation of OpenLCB. This implementation operates inside JMRI.
6 stars 9 forks source link

flaky test in datagram metering buffer #103

Closed balazsracz closed 6 years ago

balazsracz commented 6 years ago

travis has been failing occasionally with the following errors:

Failed tests:

DatagramMeteringBufferTest.testSendReplyNakRetransmitreplyOK:129 forwarded messages expected:<2> but was:<0>

DatagramMeteringBufferTest.testSendReplyOtherNakNoInterfere:164 forwarded messages expected:<1> but was:<0>

DatagramMeteringBufferTest.testSendTwoBeforeReply:199 forwarded messages expected:<1> but was:<0>

MemoryConfigurationServiceInterfaceTest.testReadWithTimeoutInterleaved:416->sendAnother:291

No interactions wanted here:

-> at org.openlcb.implementations.MemoryConfigurationServiceInterfaceTest.sendAnother(MemoryConfigurationServiceInterfaceTest.java:291)

But found this interaction on mock 'mcsReadHandler':

-> at org.openlcb.implementations.MemoryConfigurationService$3.handleFailure(MemoryConfigurationService.java:496)

Actually, above is the only interaction with this mock.

balazsracz commented 6 years ago

The DMB test flakiness is fixed by https://github.com/openlcb/OpenLCB_Java/pull/111

balazsracz commented 6 years ago

The currently flakey test is:

Failed tests: MemoryConfigurationServiceInterfaceTest.testReadWithTimeoutInterleaved:414 Wanted but not invoked: mcsReadHandler.handleReadData( 01.02.03.04.05.07, 253, 305419897L, [(byte) 0xAA] ); -> at org.openlcb.implementations.MemoryConfigurationServiceInterfaceTest.testReadWithTimeoutInterleaved(MemoryConfigurationServiceInterfaceTest.java:414) However, there was exactly 1 interaction with this mock: mcsReadHandler.handleFailure(256); -> at org.openlcb.implementations.MemoryConfigurationService$4.handleFailure(MemoryConfigurationService.java:511)

balazsracz commented 6 years ago

Fixed by https://github.com/openlcb/OpenLCB_Java/pull/117