Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12768

Building Jenkins on Windows fails with test errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows 7 x64 Ultimate
      javac 1.6.0_30 64-bit
      Jenkins 1.452
    • Similar Issues:

      Description

      Running jenkins.RemotingJarSignatureTest
      Verifying C:\Users\USER\.m2\repository\org\jenkins-ci\main\remoting\2.12\remoting-2.12.jar
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.027 sec

      Results :

      Failed tests: testRotation(hudson.util.io.ReopenableRotatingFileOutputStreamTest): expected:<Content[4]> but was:<Content[2]>

      Tests in error:
      testCopyTo2(hudson.FilePathTest): remote file operation failed: C:\Users\USER\Code\jenkins\jenkins\core\target\testCopyTo6068700686750233812 at hudson.remoting.Channel@17094d48:The other side of the channel
      testRemoting(hudson.util.ProcessTreeTest): Failed to read environment variable table error=299 at .\envvar-cmdline.cpp:114
      testIsSymlink(hudson.UtilTest): got: <false>, expected: is <true>

      Tests run: 2429, Failures: 1, Errors: 3, Skipped: 0

      The testCopyTo2 test functions correctly on a 32-bit JDK, but the other tests fail for the same reasons.

        Attachments

          Issue Links

            Activity

            Hide
            wolfgang Christian Wolfgang added a comment -

            I have a similar problem. I have the following unit test:

            FreeStyleProject project = createFreeStyleProject( "drmemory" );
            
            final InputStream in = getClass().getClassLoader().getResourceAsStream( "results.txt" );
            
            /* To get the real workspace and copy the results.txt */
            project.getBuildersList().add(new TestBuilder() {
                public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
                    BuildListener listener) throws InterruptedException, IOException {
                    build.getWorkspace().child("drmemory").child( "1" ).child( "results.txt" ).copyFrom( in );
                    return true;
                }
            });
            
            Builder builder = new DrMemoryBuilder( "", "", "drmemory" );
            project.getBuildersList().add( builder );
            		
            DrMemoryPublisher publisher = new DrMemoryPublisher();
            project.getPublishersList().add( publisher );
            		
            FreeStyleBuild b = project.scheduleBuild2( 0, new Cause.UserIdCause() ).get();
            

            which results in a "Failed to clean up temp dirs" error, because the publisher copies the file "drmemory/1/results.txt" to the builds folder and it is unable to delete that file.

            Show
            wolfgang Christian Wolfgang added a comment - I have a similar problem. I have the following unit test: FreeStyleProject project = createFreeStyleProject( "drmemory" ); final InputStream in = getClass().getClassLoader().getResourceAsStream( "results.txt" ); /* To get the real workspace and copy the results.txt */ project.getBuildersList().add( new TestBuilder() { public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child( "drmemory" ).child( "1" ).child( "results.txt" ).copyFrom( in ); return true ; } }); Builder builder = new DrMemoryBuilder( "", " ", " drmemory" ); project.getBuildersList().add( builder ); DrMemoryPublisher publisher = new DrMemoryPublisher(); project.getPublishersList().add( publisher ); FreeStyleBuild b = project.scheduleBuild2( 0, new Cause.UserIdCause() ).get(); which results in a "Failed to clean up temp dirs" error, because the publisher copies the file "drmemory/1/results.txt" to the builds folder and it is unable to delete that file.
            Hide
            erik_molekamp Erik Molekamp added a comment -

            Status update:

            • testRotation(hudson.util.io.ReopenableRotatingFileOutputStreamTest): fixed by pull request jenkinsci/jenkins#582; to be merged
            • testCopyTo2(hudson.FilePathTest): the test has been renamed to testNoFileLeakInCopyTo; I have not been able to reproduce this error yet, probably because I have a 32-bit JDK
            • testRemoting(hudson.util.ProcessTreeTest): still failing, although I get a slightly different error message: Failed to open process error=87 at .\envvar-cmdline.cpp:53
            • testIsSymlink(hudson.UtilTest): fixed (see JENKINS-14641)

            So, I'm down to 1 failing test, but I don't have a clue how to even start looking for a fix for this one. I can't even find the referenced C++ source file, envvar-cmdline.cpp. Does anybody have any hints/ideas?

            Erik

            Show
            erik_molekamp Erik Molekamp added a comment - Status update: testRotation(hudson.util.io.ReopenableRotatingFileOutputStreamTest): fixed by pull request jenkinsci/jenkins#582 ; to be merged testCopyTo2(hudson.FilePathTest): the test has been renamed to testNoFileLeakInCopyTo; I have not been able to reproduce this error yet, probably because I have a 32-bit JDK testRemoting(hudson.util.ProcessTreeTest): still failing , although I get a slightly different error message: Failed to open process error=87 at .\envvar-cmdline.cpp:53 testIsSymlink(hudson.UtilTest): fixed (see JENKINS-14641 ) So, I'm down to 1 failing test, but I don't have a clue how to even start looking for a fix for this one. I can't even find the referenced C++ source file, envvar-cmdline.cpp. Does anybody have any hints/ideas? Erik
            Hide
            slide_o_mix Alex Earl added a comment -

            This mailing list thread seems to think that process id's 0 and 4 should be filtered? http://jenkins.361315.n4.nabble.com/Re-hudson-util-ProcessTreeTest-test-error-td2269355.html

            Show
            slide_o_mix Alex Earl added a comment - This mailing list thread seems to think that process id's 0 and 4 should be filtered? http://jenkins.361315.n4.nabble.com/Re-hudson-util-ProcessTreeTest-test-error-td2269355.html
            Hide
            slide_o_mix Alex Earl added a comment -

            It looks like process id 0 is the system idle process and process id 4 is another system process, so filtering those two should be ok I think.

            Show
            slide_o_mix Alex Earl added a comment - It looks like process id 0 is the system idle process and process id 4 is another system process, so filtering those two should be ok I think.
            Hide
            erik_molekamp Erik Molekamp added a comment -

            Agreed, filtering 0 and 4 should not cause any problems. However, it also doesn't consistently fix the test. It seems to depend heavily on what kind of processes are running, or even what kind of mood Windows is in. For instance, today I get error=87 for PID=0, and filtering out 0 fixes the test. However, two days ago, I got error=5 for PID 2200, belonging to svchost.exe, which was linked to 5 services. Today, those same 5 services are also running (this time with PID 2188), but they do not make the test fail.

            Show
            erik_molekamp Erik Molekamp added a comment - Agreed, filtering 0 and 4 should not cause any problems. However, it also doesn't consistently fix the test. It seems to depend heavily on what kind of processes are running, or even what kind of mood Windows is in. For instance, today I get error=87 for PID=0, and filtering out 0 fixes the test. However, two days ago, I got error=5 for PID 2200, belonging to svchost.exe, which was linked to 5 services. Today, those same 5 services are also running (this time with PID 2188), but they do not make the test fail.
            Hide
            erik_molekamp Erik Molekamp added a comment -

            I just found that the problem with ProcessTreeTest is also described in: https://issues.jenkins-ci.org/browse/JENKINS-8614
            Looks like it's been around for a while (reported January 2011).

            Since all the other test errors reported in this issue have been solved, this remaining problem is in fact a duplicate of 8614. I therefore suggest that this issue be closed.

            Show
            erik_molekamp Erik Molekamp added a comment - I just found that the problem with ProcessTreeTest is also described in: https://issues.jenkins-ci.org/browse/JENKINS-8614 Looks like it's been around for a while (reported January 2011). Since all the other test errors reported in this issue have been solved, this remaining problem is in fact a duplicate of 8614. I therefore suggest that this issue be closed.
            Hide
            evernat evernat added a comment -

            as suggested in the comments, resolving as duplicate of JENKINS-8614

            Show
            evernat evernat added a comment - as suggested in the comments, resolving as duplicate of JENKINS-8614

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                slide_o_mix Alex Earl
              • Votes:
                4 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: