You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Martin Ritchie <ri...@apache.org> on 2008/07/15 18:25:24 UTC

Java - CPP Test profile failures

Hi,

When running on my RHEL4 box with -Dprofile=cpp I'm getting a number
of failures due to the way we run our tests.

As a fresh broker is created for each test it appears that
occasionally the Socket hasn't been released so the next test can't
have a fresh broker.

Has anyone else found this? How easy would it be for the tests to
start the broker on a random port or for the broker to pick a free
port to start up on and the QpidTestCase to extract that and use it in
the tests?


This is the output of TransactedTest but there were a number of other
test that had similar failures.

2008-jul-15 17:21:05 debug Exception constructed: Can't bind to port
5672: Address already in use (qpid/sys/posix/Socket.cpp:205)
Can't bind to port 5672: Address already in use (qpid/sys/posix/Socket.cpp:205)
main 2008-07-15 17:21:05,331 INFO [qpid.test.utils.QpidTestCase]
broker aborted: 1
main 2008-07-15 17:21:05,331 INFO [qpid.test.utils.QpidTestCase]
clean: /home/ritchiem/dev/Apache/git/qpid-dev/qpid/java/clean-dir
/home/ritchiem/dev/Apache/git/qpid-dev/qpid/java/build/data
main 2008-07-15 17:21:05,366 INFO [qpid.test.utils.QpidTestCase] clean exited: 0
------------- ---------------- ---------------

Testcase: testCommit took 3.008 sec
Testcase: testRollback took 5.65 sec
Testcase: testResendsMsgsAfterSessionClose took 0.097 sec
        Caused an ERROR
broker aborted: 1
java.lang.RuntimeException: broker aborted: 1
        at org.apache.qpid.test.utils.QpidTestCase.startBroker(QpidTestCase.java:288)
        at org.apache.qpid.test.utils.QpidTestCase.runBare(QpidTestCase.java:157)
        at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:186)


-- 
Martin Ritchie

Re: Java - CPP Test profile failures

Posted by Rafael Schloming <ra...@redhat.com>.
Martin Ritchie wrote:
> Hi,
> 
> When running on my RHEL4 box with -Dprofile=cpp I'm getting a number
> of failures due to the way we run our tests.
> 
> As a fresh broker is created for each test it appears that
> occasionally the Socket hasn't been released so the next test can't
> have a fresh broker.
> 
> Has anyone else found this? How easy would it be for the tests to
> start the broker on a random port or for the broker to pick a free
> port to start up on and the QpidTestCase to extract that and use it in
> the tests?

I haven't seen this particular issue before. I'm a bit puzzled by how it 
can occur since I believe the broker sets the SO_REUSADDR option on the 
socket, and QpidTestCase should block until the broker process exits.

In any case, I think it shouldn't be too difficult to make the change 
you suggest. If you specify -p0 the broker will bind to an unused port. 
QpidTestCase already scans for a log message from the broker in order to 
verify that it has actually bound to the port before allowing the test 
to run. It should be straightforward to modify that same code to regex 
out the chosen port number.

--Rafael