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 junit.framework.Assert.fail(Assert.java:47)
> 	at junit.framework.Assert.failNotEquals(Assert.java:280)
> 	at junit.framework.Assert.assertEquals(Assert.java:64)
> 	at junit.framework.Assert.assertEquals(Assert.java:198)
> 	at junit.framework.Assert.assertEquals(Assert.java:204)
> 	at org.eclipse.jgit.http.test.SmartClientSmartServerTest.testPush_NotAuthorized(SmartClientSmartServerTest.java:400)

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.

-- 
Shawn.


Back to the top