Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319178

Summary: test failures in jetty-util module
Product: [RT] Jetty Reporter: Dmytro Pishchukhin <dmytro.pishchukhin>
Component: buildAssignee: Jesse McConnell <jesse.mcconnell>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox, mgorovoy, schuellerf
Version: 7.1.5   
Target Milestone: 7.1.x   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Dmytro Pishchukhin CLA 2010-07-07 14:33:09 EDT
Build Identifier: 7.1.5, trunk

-------------------------------------------------------------------------------
Test set: org.eclipse.jetty.util.log.LogTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec <<< FAILURE!
testStdErrThrowable(org.eclipse.jetty.util.log.LogTest)  Time elapsed: 0.009 sec  <<< FAILURE!
java.lang.AssertionError: 
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at org.junit.Assert.assertTrue(Assert.java:54)
	at org.eclipse.jetty.util.log.LogTest.logContains(LogTest.java:69)
	at org.eclipse.jetty.util.log.LogTest.testStdErrThrowable(LogTest.java:144)
....


-------------------------------------------------------------------------------
Test set: org.eclipse.jetty.util.thread.QueuedThreadPoolTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 14.111 sec <<< FAILURE!
testShrink(org.eclipse.jetty.util.thread.QueuedThreadPoolTest)  Time elapsed: 5.503 sec  <<< FAILURE!
java.lang.AssertionError: expected:<2> but was:<3>
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.failNotEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:126)
	at org.junit.Assert.assertEquals(Assert.java:470)
	at org.junit.Assert.assertEquals(Assert.java:454)
	at org.eclipse.jetty.util.thread.QueuedThreadPoolTest.testShrink(QueuedThreadPoolTest.java:187)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Reproducible: Always
Comment 1 Jesse McConnell CLA 2010-07-07 14:36:51 EDT
you indicate this is always reproducible..

I have never seen these we remotely reproducible so if they actually are for you please indicate what your java version is and what operating system your on (really vista?)

thanks
Comment 2 Dmytro Pishchukhin CLA 2010-07-07 14:45:41 EDT
(In reply to comment #1)
> you indicate this is always reproducible..
> 
> I have never seen these we remotely reproducible so if they actually are for
> you please indicate what your java version is and what operating system your on
> (really vista?)
> 
> thanks

It's also strange for me to see those failures. I've tried trunk and 7.1.5 tag. Result is the same.

C:\Projects\jetty>c:\tools\maven-2\bin\mvn -v
C:\Projects\jetty>set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=256m
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_18
Java home: C:\Tools\jdk1.6.0\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"

Regards,
Dmytro
Comment 3 Dmytro Pishchukhin CLA 2010-07-07 14:49:55 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > you indicate this is always reproducible..
> > 
> > I have never seen these we remotely reproducible so if they actually are for
> > you please indicate what your java version is and what operating system your on
> > (really vista?)
> > 
> > thanks
> 
> It's also strange for me to see those failures. I've tried trunk and 7.1.5 tag.
> Result is the same.
> 
> C:\Projects\jetty>c:\tools\maven-2\bin\mvn -v
> C:\Projects\jetty>set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=256m
> Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.6.0_18
> Java home: C:\Tools\jdk1.6.0\jre
> Default locale: en_GB, platform encoding: Cp1252
> OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"
> 
> Regards,
> Dmytro

I've tried to build only jetty-util module and I've got only org.eclipse.jetty.util.log.LogTest.logContains(LogTest.java:69)
 failure.

Regards,
Dmytro
Comment 4 Dmytro Pishchukhin CLA 2010-07-08 03:59:27 EDT
FYI: I can reproduce this test failure at my work PC also:

D:\Users\DmytroPishchukhin\Projekte\jetty>mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_13
Java home: D:\Users\DmytroPishchukhin\Tools\jdk1.6.0_13\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"
Comment 5 Jesse McConnell CLA 2010-09-14 15:30:03 EDT
guess I'll have to track down a vista machine to try and build jetty with
Comment 6 Flo CLA 2010-11-06 13:56:11 EDT
Hi!
I had the same problem with vista (but with jetty-8.0.0.M1)

There seems to be a problem with windows and unix newlines mixed up

adding the lines
        err = err.replaceAll("\r\n","\n");
        text = text.replaceAll("\r\n","\n");
to LogTest.java
is a workaround

---
    private void logContains(String text)
    {
        _pout.flush();
        String err = _out.toString();
        _out.reset();

        err = err.replaceAll("\r\n","\n");
        text = text.replaceAll("\r\n","\n");
        
        if (err.indexOf(text)>=0)
            return;
        
        _orig.println("FAIL '"+text+"' not in '"+err+"'");

        assertTrue(false);
    }
---
Comment 7 Jesse McConnell CLA 2011-01-12 16:35:48 EST
[rune]trunks/jetty> svn commit -m "Bug 319178 test failure fix in jetty-util on windows" jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java VERSION.txt
Sending        VERSION.txt
Sending        jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java
Transmitting file data ..
Committed revision 2656.

Thanks Flo for figuring out what the issue was!

cheers