Qpid Proton
  1. Qpid Proton
  2. PROTON-214

Test "proton_tests.messenger.MessengerTest.testSendBogus" failed

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.3, 0.4
    • Fix Version/s: 0.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Run "mvn test" from a clean checkout - this uses proton-j by default.

      Description

      The system test "proton_tests.messenger.MessengerTest.testSendBogus" is failing against both the proton-jni profile and, on certain computers, when run against proton-j too.

      The proton-jni problem seems to be caused by the fact the the JNI Messenger implementation ignores proton-c's error return codes.

      I think I've seen this test pass occasionally against proton-j so I suspect there's something unreliable about the test.

      Here is the output.

      proton_tests.messenger.MessengerTest.testSendBogus ......................Feb 4, 2013 2:07:19 PM org.apache.qpid.proton.messenger.impl.MessengerImpl processActive
      SEVERE: Error processing connection
      java.io.IOException: Connection reset by peer
      at sun.nio.ch.FileDispatcher.read0(Native Method)
      at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
      at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
      at sun.nio.ch.IOUtil.read(IOUtil.java:206)
      at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
      at org.apache.qpid.proton.driver.impl.ConnectorImpl.read(ConnectorImpl.java:95)
      at org.apache.qpid.proton.driver.impl.ConnectorImpl.process(ConnectorImpl.java:80)
      at org.apache.qpid.proton.messenger.impl.MessengerImpl.processActive(MessengerImpl.java:426)
      at org.apache.qpid.proton.messenger.impl.MessengerImpl.waitUntil(MessengerImpl.java:525)
      at org.apache.qpid.proton.messenger.impl.MessengerImpl.waitUntil(MessengerImpl.java:506)
      at org.apache.qpid.proton.messenger.impl.MessengerImpl.send(MessengerImpl.java:205)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.python.core.PyReflectedFunction._call_(PyReflectedFunction.java:186)
      at org.python.core.PyReflectedFunction._call_(PyReflectedFunction.java:204)
      at org.python.core.PyObject._call_(PyObject.java:387)
      at org.python.core.PyObject._call_(PyObject.java:391)
      at org.python.core.PyMethod._call_(PyMethod.java:109)
      at proton$py.send$201(_pyclasspath_/proton.py:997)
      at proton$py.call_function(_pyclasspath_/proton.py)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
      at org.python.core.PyFunction._call_(PyFunction.java:317)
      at org.python.core.PyMethod._call_(PyMethod.java:109)
      at proton_tests.messenger$py.teardown$4(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton_tests/messenger.py:52)
      at proton_tests.messenger$py.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton_tests/messenger.py)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
      at org.python.core.PyFunction._call_(PyFunction.java:317)
      at org.python.core.PyMethod._call_(PyMethod.java:109)
      at org.python.pycode._pyx1.run$36(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test:344)
      at org.python.pycode._pyx1.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:166)
      at org.python.core.PyFunction._call_(PyFunction.java:338)
      at org.python.core.PyMethod._call_(PyMethod.java:139)
      at org.python.pycode._pyx1._run$55(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test:484)
      at org.python.pycode._pyx1.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
      at org.python.core.PyFunction._call_(PyFunction.java:317)
      at org.python.core.PyMethod._call_(PyMethod.java:109)
      at org.python.pycode._pyx1.run_test$41(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test:412)
      at org.python.pycode._pyx1.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:166)
      at org.python.core.PyFunction._call_(PyFunction.java:338)
      at org.python.pycode._pyx1.run$54(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test:460)
      at org.python.pycode._pyx1.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
      at org.python.core.PyFunction._call_(PyFunction.java:317)
      at org.python.core.PyMethod._call_(PyMethod.java:109)
      at org.python.pycode._pyx1.f$0(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test:650)
      at org.python.pycode._pyx1.call_function(/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyCode.call(PyCode.java:18)
      at org.python.core.Py.runCode(Py.java:1275)
      at org.python.core._builtin.execfile_flags(builtin_.java:522)
      at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225)
      at org.apache.qpid.proton.JythonTest.test(JythonTest.java:70)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      fail
      Error during teardown: Traceback (most recent call last):
      File "/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton-test", line 337, in run
      phase()
      File "/fast/.jenkins/jobs/Trunk-Proton-J/workspace/proton/tests/target/classes/proton_tests/messenger.py", line 48, in teardown
      self.client.send()
      File "_pyclasspath_/proton.py", line 997, in send
      TimeoutException: java.util.concurrent.TimeoutException

        Activity

        Hide
        Philip Harvey added a comment -

        Gordon kindly agreed to take a look at this as he is familiar with the Messenger tests.

        Show
        Philip Harvey added a comment - Gordon kindly agreed to take a look at this as he is familiar with the Messenger tests.
        Hide
        Gordon Sim added a comment -

        I actually think there is a race in the test logic, where the server can see the running flag has been turned off and stops before the client actually manages to establish a connection. In the testSendBogus() test the window for this race is somewhat larger than other tests as the test itself does not establish the connection to the server (that is done on teardown in response to sending the trigger message).

        That said, this does also raise the question of how failure to connect should be signalled. Should send() throw an exception in this case rather than timing out?

        Show
        Gordon Sim added a comment - I actually think there is a race in the test logic, where the server can see the running flag has been turned off and stops before the client actually manages to establish a connection. In the testSendBogus() test the window for this race is somewhat larger than other tests as the test itself does not establish the connection to the server (that is done on teardown in response to sending the trigger message). That said, this does also raise the question of how failure to connect should be signalled. Should send() throw an exception in this case rather than timing out?
        Hide
        Gordon Sim added a comment -

        Downgraded the severity as I think this is primarily an issue with the test rather than exposing underlying unreliability in the messenger implementation itself. Of course failing tests are never a good thing, so it should still be fixed.

        Show
        Gordon Sim added a comment - Downgraded the severity as I think this is primarily an issue with the test rather than exposing underlying unreliability in the messenger implementation itself. Of course failing tests are never a good thing, so it should still be fixed.
        Hide
        Philip Harvey added a comment -

        This test was also failing when run under the proton-jni profile, because JNIMessenger does not yet handle non-zero (ie non-success) returns codes from proton-c functions. I have modified it to throw ProtonUnsupportedOperationException's in revision 1448962 so that this test skips rather than fails when using proton-jni.

        Leaving this Jira open until the proton-j problem is also resolved.

        Show
        Philip Harvey added a comment - This test was also failing when run under the proton-jni profile, because JNIMessenger does not yet handle non-zero (ie non-success) returns codes from proton-c functions. I have modified it to throw ProtonUnsupportedOperationException's in revision 1448962 so that this test skips rather than fails when using proton-jni. Leaving this Jira open until the proton-j problem is also resolved.
        Hide
        Rob Godfrey added a comment -

        Attached a small patch for the JNIMessenger to throw a relevant exception when checking the return code from calls to native methods

        Show
        Rob Godfrey added a comment - Attached a small patch for the JNIMessenger to throw a relevant exception when checking the return code from calls to native methods
        Hide
        Philip Harvey added a comment -

        Hi Gordon,
        Would you mind looking at my commit to fix this race condition please? It's r1459089.
        Thanks.

        Show
        Philip Harvey added a comment - Hi Gordon, Would you mind looking at my commit to fix this race condition please? It's r1459089. Thanks.
        Hide
        Gordon Sim added a comment -

        Looks fine to me!

        Show
        Gordon Sim added a comment - Looks fine to me!

          People

          • Assignee:
            Philip Harvey
            Reporter:
            Philip Harvey
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development