[QFJ-838] Tests on jdk 1.7 failed Created: 15/Apr/15  Updated: 21/Apr/16  Resolved: 23/Dec/15

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.6.0
Fix Version/s: 1.6.2

Type: Bug Priority: Default
Reporter: Slawomir Pawlewicz Assignee: Marcin L
Resolution: Fixed Votes: 1
Labels: session
Environment:

jdk 1.7.0_45 on Win7 x64


Issue Links:
Duplicate
is duplicated by QFJ-837 Tests on jdk1.8 fail Closed

 Description   

Tests passed on jdk 1.6. On jdk 1.7 they failed
-------------------------------------------------------------------------------
Test set: quickfix.SessionTest
-------------------------------------------------------------------------------
Tests run: 47, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 1.197 sec <<< FAILURE! - in quickfix.SessionTest
testResendRequestMsgSeqNum(quickfix.SessionTest) Time elapsed: 0.006 sec <<< FAILURE!
java.lang.AssertionError: Session should be logged out since seqnum too low!
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertFalse(Assert.java:68)
at quickfix.SessionTest.testResendRequestMsgSeqNum(SessionTest.java:1172)

testAcceptorRelogon(quickfix.SessionTest) Time elapsed: 0.002 sec <<< FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:92)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertFalse(Assert.java:68)
at org.junit.Assert.assertFalse(Assert.java:79)
at quickfix.SessionTest.testAcceptorRelogon(SessionTest.java:1632)

testLogoutMsgSeqNumTooHighOrLow(quickfix.SessionTest) Time elapsed: 0.001 sec <<< FAILURE!
java.lang.AssertionError: expected:<3> but was:<4>
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.failNotEquals(Assert.java:647)
at org.junit.Assert.assertEquals(Assert.java:128)
at org.junit.Assert.assertEquals(Assert.java:472)
at org.junit.Assert.assertEquals(Assert.java:456)
at quickfix.SessionTest.testLogoutMsgSeqNumTooHighOrLow(SessionTest.java:418)



 Comments   
Comment by Michael Whidden [ 11/Oct/15 ]

I'm coming across the same issue. What I observe is that the Logout messages (and most other messages generated in SessionTest.java) are dropped on the floor due to issues with the UtcTimeStamp.

Many tests call [[SystemTime.setTimeSource(systemTimeSource)]] where [[systemTimeSource]] has been set to [[new Date(1348264800000L);]]. Later tests will generate a message using [[createAdminMessage(2);]] or similar, which set the UtcTimeStamp as [[new Date();]]. These messages are never processed, because they cause [[<20120922-22:58:20, FIX.4.4:SENDER->TARGET, error> (Reject sent for Message 2: SendingTime accuracy problem)]] since the UtcTimeStamp is more that 120s different from SystemTime.

I think the fix is to reset SystemTime to use the actual system clock after each test.

Comment by Michael Whidden [ 11/Oct/15 ]

Changing{ {@AfterClass public static void cleanup()}} to @After public void cleanup() fixes the problem by restoring the SystemTime after each unit test.

Generated at Sat Nov 23 07:15:51 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.