The Open Anzo Project

Semantic Application Middleware

Ticket #234 (assigned defect)

Opened 1 year ago

Last modified 8 months ago

Intermittent Failure of JMSClientTest

Reported by: jordi Assigned to: jordi (accepted)
Priority: major Milestone: 3.0 milestone1
Component: openanzo-js Version: 3.0
Keywords: Cc: ben

Description

The JMSClient test intermittently fails. when this happens in the build is can look like this:

java.lang.Exception: Failed Anzo.JS JavaScript Unit Tests: 
anzo.tests.messaging.JMSClientTest : testConnect3 
anzo.tests.messaging.JMSClientTest : testConnect4 
	at org.openanzo.test.js.TestAnzoJsDohRegression.testAnzoJavaScriptTests(TestAnzoJsDohRegression.java:53) 
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
...

The logs show:

------------------------------------------------------------
GROUP "anzo.tests.messaging.JMSClientTest" has 6 tests to run
connectComplete....
...connected
disconnectCallback....
...disconnected
PASSED test: testConnect
initComplete....
...connected
disconnectCallback....
...disconnected
checking condition: true/true
PASSED test: testConnect2
connectComplete....
Connection failed, checking reason...
Connection timeout
disconnectCallback after timeout....
...disconnected
PASSED test: testConnectTimeout
 [ Error: already called! ]
initComplete....
...connected
Connection timeout
disconnectCallback after timeout....
...disconnected
PASSED test: testConnectTimeout
 [ Error: already called! ]
initComplete....
...connected
...connected
...connected
disconnectCallback....
...disconnected
checking condition: true/true
PASSED test: testAgain
Consider using mimetype:text/json-comment-filtered to avoid potential security i
ssues with JSON endpoints (use djConfig.usePlainJson=true to turn off this messa
ge)
 [ Error: test timeout in testConnect3 ]
 ERROR IN: (function () {var connected = false;var d = new doh.Deferred;var disc
onnectCallback = function (status, message) {console.debug("disconnectCallback..
 ERROR IN: (function () {var connected = false;var d = new doh.Deferred;var disc
onnectCallback = function (status, message) {console.debug("disconnectCallback..
..");if (status == anzo.messaging.CONNECTION_STATUS_DISCONNECTED) {console.debug
("...disconnected");disconnected = true;}if (!connected) {d.errback(new Error("N
ot connected"));} else if (!disconnected) {d.errback(new Error("Didn't disconect
"));} else {d.callback(true);}};var initCallback = function (status, message) {c
onsole.debug("initComplete....");if (status == anzo.messaging.CONNECTION_STATUS_
CONNECTED) {console.debug("...connected");connected = true;} else {console.debug
("msg: " + message[anzo.messaging.CONTROL_MSG_ERROR_MESSSAGE]);d.errback(new Err
or("JMS connection failure:" + message[anzo.messaging.CONTROL_MSG_ERROR_MESSSAGE
]));}anzo.messaging.JMSClient.disconnect(disconnectCallback);};anzo.messaging.JM
 [ Error: already called! ]
initComplete....
...connected
disconnectCallback....
...disconnected
checking condition: true/true
PASSED test: testAgain
Consider using mimetype:text/json-comment-filtered to avoid potential security i
ssues with JSON endpoints (use djConfig.usePlainJson=true to turn off this messa
ge)
 [ Error: test timeout in testConnect3 ]
PASSED test: testConnectTimeout
 [ Error: already called! ]
initComplete....
...

Investigation points toward a race condition with the timeout test in JMSClientTest. The test causes a timeout but that doesn't stop all of the cometd setup. The test realizes this and so tries to disconnect just to be safe. But that disconnect may happen as the test is still in the middle of connecting. I believe that causes things to get confused.

Then subsequent tests have trouble connecting to the server.

Change History

02/13/08 15:51:57 changed by jordi

(In [1775]) refs #234. Comment out intermittently failing Anzo.JS test. Refactor the JMSClientTest to remove copy/paste and make the tests more robust. Also added a test for the case of 404 errors when connecting. Fixing 404 handling required a cometd patch because cometd just swallows the error.

05/28/08 15:25:53 changed by jordi

  • status changed from new to assigned.
Copyright © 2007 - 2008 OpenAnzo.org