Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] sporadic test failures in org.eclipse.jgit.http.test

Matthias Sohn <matthias.sohn@xxxxxxxxxxxxxx> wrote:
> org.eclipse.jgit.http.test.SmartClientSmartServerTest.testPush_NotAuthorized(from
> SmartClientSmartServerTest) Error
> Message
> expected:<1> but was:<0>
> Stacktrace
> junit.framework.AssertionFailedError: expected:<1> but was:<0>
> 	at
> 	at junit.framework.Assert.failNotEquals(
> 	at junit.framework.Assert.assertEquals(
> 	at junit.framework.Assert.assertEquals(
> 	at junit.framework.Assert.assertEquals(
> 	at org.eclipse.jgit.http.test.SmartClientSmartServerTest.testPush_NotAuthorized(

I think this might be a race condition.

The JUnit worker thread was able to look at the request array
before the background thread running the Jetty server was able
to post the details of the most recent request into it.  Thus
the JUnit worker thread thinks it made 0 HTTP requests, and
the test fails the assertion.

I'll try to work up a patch to fix this in a minute.  It
looks like I need to halt the server before we try to get
the requests.


Back to the top