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

unit tests failures in core on windows

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • core

    Description

      See attached log and surefire reports directory.

      Failed tests:
        RunTest.getLogReturnsAnRightOrder:192 expected:<[...truncated [6]8 B...]> but was:<[...truncated [7]8 B...]>
        SecretRewriterTest.recursionDetection:100 assert 6==sw.rewriteRecursive(t, st)
              | |  |                |  |
              | |  5                |  hudson.util.StreamTaskListener@19855799
              | |                   C:\workarea\source\github\jenkinsci\temp\jenkins\core\target\junit5825166057877884911\t
              | hudson.util.SecretRewriter@bd09a26
              false
        RunIdMigratorTest.legacy:86 expected:<...otherstuff>
      </run>'}[, 99=?2014-01-02_03-04-05, lastFailedBuild=?-1, lastSuccessfulBuild=?99]}> but was:<...otherstuff>
      </run>'}[]}>
        RunIdMigratorTest.reRunMigration:105 expected:<.../number>
      </run>'}, 9[8=?2014-01-02_03-04-04, 99={build.xml='<?xml version='1.0' encoding='UTF-8'?>
      <run>
        <stuff>ok</stuff>
        <timestamp>1388649845000</timestamp>
        <otherstuff>ok</otherstuff>
      </run>'}, lastFailedBuild=?-1, lastSuccessfulBuild=?99]}> but was:<.../number>
      </run>'}, 9[9={build.xml='<?xml version='1.0' encoding='UTF-8'?>
      <run>
        <stuff>ok</stuff>
        <timestamp>1388649845000</timestamp>
        <otherstuff>ok</otherstuff>
      </run>'}]}>
        RunIdMigratorTest.reverseAfterNewBuilds:129 expected:<{[1=?2014-01-02_03-04-05, ]2014-01-02_03-04-05=...> but was:<{[]2014-01-02_03-04-05=...>
        RunIdMigratorTest.reverseImmediately:117 expected:<...erstuff>
      </run>'}, l[astFailedBuild=?-1, lastSuccessfulBuild=?99, l]egacyIds='2014-01-02...> but was:<...erstuff>
      </run>'}, l[]egacyIds='2014-01-02...>
        RunIdMigratorTest.reverseMatrixAfterNewBuilds:139 expected:<{[1=?2014-01-02_03-04-05, ]2014-01-02_03-04-05=...> but was:<{[]2014-01-02_03-04-05=...>
        RunIdMigratorTest.reverseMavenAfterNewBuilds:149 expected:<{[1=?2014-01-02_03-04-05, ]2014-01-02_03-04-05=...> but was:<{[]2014-01-02_03-04-05=...>
        VirtualFileTest.outsideSymlinks:53
      
      Tests run: 3484, Failures: 9, Errors: 0, Skipped: 9
      

      Attachments

        Issue Links

          Activity

            teilo James Nord created issue -
            slide_o_mix Alex Earl added a comment -

            Part of the failures are because of symlinks. I get this warning:

            Symbolic links enabled on this platform but disabled for this user; run as administrator or use Local Security Policy > Security Settings > Local Policies > User Rights Assignment > Create symbolic links
            

            I ran powershell as an admin (didn't try the part about Local Security Policy yet) and the errors are down to 1

            Failed tests:
              RunTest.getLogReturnsAnRightOrder:192 expected:<[...truncated [6]8 B...]> but was:<[...truncated [7]8 B...]>
            

            The issue with this one is that the person who wrote the test didn't take into account Windows line endings which add an additional 10 bytes to the trucated count. A small patch like follows allows that test to pass:

                int byteCount = 68;
                if(Utils.isWindows()) {
                    byteCount += 10;
                }
                assertEquals("[...truncated "+byteCount+" B...]", logLines.get(0));
            
            slide_o_mix Alex Earl added a comment - Part of the failures are because of symlinks. I get this warning: Symbolic links enabled on this platform but disabled for this user; run as administrator or use Local Security Policy > Security Settings > Local Policies > User Rights Assignment > Create symbolic links I ran powershell as an admin (didn't try the part about Local Security Policy yet) and the errors are down to 1 Failed tests: RunTest.getLogReturnsAnRightOrder:192 expected:<[...truncated [6]8 B...]> but was:<[...truncated [7]8 B...]> The issue with this one is that the person who wrote the test didn't take into account Windows line endings which add an additional 10 bytes to the trucated count. A small patch like follows allows that test to pass: int byteCount = 68; if (Utils.isWindows()) { byteCount += 10; } assertEquals( "[...truncated " +byteCount+ " B...]" , logLines.get(0));
            slide_o_mix Alex Earl added a comment -

            I do get the following error though for the war

            [INFO] --- frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) @ jenkins-war ---
            [INFO] Installing node version v4.0.0
            [INFO] Downloading file:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe to C:\Users\USER\.m2\repository\com\github\eirslett\node\4.0.0\node-4.0.0-windows-x86.exe
            [INFO] ------------------------------------------------------------------------
            [INFO] Reactor Summary:
            [INFO]
            [INFO] Jenkins main module ................................ SUCCESS [  5.636 s]
            [INFO] Jenkins cli ........................................ SUCCESS [ 19.834 s]
            [INFO] Jenkins core ....................................... SUCCESS [10:58 min]
            [INFO] Jenkins war ........................................ FAILURE [ 27.832 s]
            [INFO] Tests for Jenkins core ............................. SKIPPED
            [INFO] ------------------------------------------------------------------------
            [INFO] BUILD FAILURE
            [INFO] ------------------------------------------------------------------------
            [INFO] Total time: 11:53 min
            [INFO] Finished at: 2016-12-07T15:37:17-07:00
            [INFO] Final Memory: 55M/194M
            [INFO] ------------------------------------------------------------------------
            [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) on project jenkins-war: Could not download Node.js from: ile:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe: Could not download file:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe: Source 'C:\code\_external\jenkins\war\target\frontend\v4.0.0\win-x86\node.exe' does not exist -> [Help 1]
            
            slide_o_mix Alex Earl added a comment - I do get the following error though for the war [INFO] --- frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) @ jenkins-war --- [INFO] Installing node version v4.0.0 [INFO] Downloading file:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe to C:\Users\USER\.m2\repository\com\github\eirslett\node\4.0.0\node-4.0.0-windows-x86.exe [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Jenkins main module ................................ SUCCESS [ 5.636 s] [INFO] Jenkins cli ........................................ SUCCESS [ 19.834 s] [INFO] Jenkins core ....................................... SUCCESS [10:58 min] [INFO] Jenkins war ........................................ FAILURE [ 27.832 s] [INFO] Tests for Jenkins core ............................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11:53 min [INFO] Finished at: 2016-12-07T15:37:17-07:00 [INFO] Final Memory: 55M/194M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) on project jenkins-war: Could not download Node.js from: ile:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe: Could not download file:/C:/code/_external/jenkins/war/target/frontend/v4.0.0/win-x86/node.exe: Source 'C:\code\_external\jenkins\war\target\frontend\v4.0.0\win-x86\node.exe' does not exist -> [Help 1]
            danielbeck Daniel Beck added a comment -

            Is this 32 bit Windows or JDK?

            danielbeck Daniel Beck added a comment - Is this 32 bit Windows or JDK?
            slide_o_mix Alex Earl added a comment -

            Mine is 64bit for both

            slide_o_mix Alex Earl added a comment - Mine is 64bit for both
            slide_o_mix Alex Earl added a comment -

            My bad, the JDK is 32-bit.

            slide_o_mix Alex Earl added a comment - My bad, the JDK is 32-bit.
            slide_o_mix Alex Earl added a comment -

            If I switch to a 64-bit JDK, the build completes successfully

            slide_o_mix Alex Earl added a comment - If I switch to a 64-bit JDK, the build completes successfully
            jglick Jesse Glick added a comment -

            christ66 had a patch in progress to remove use of symlinks for build metadata, which would possibly obviate those failures.

            jglick Jesse Glick added a comment - christ66 had a patch in progress to remove use of symlinks for build metadata, which would possibly obviate those failures.
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Labels testing windows
            slide_o_mix Alex Earl added a comment -

            I'm looking into a PR for the Jenkinsfile to build on a Windows node as well. This has been missing for a while.

            slide_o_mix Alex Earl added a comment - I'm looking into a PR for the Jenkinsfile to build on a Windows node as well. This has been missing for a while.
            teilo James Nord added a comment - - edited

            slide_o_mix - note that https://ci.jenkins.io/job/Core_Folder/job/jenkins_master and https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/ are currently FreeStyle jobs, maybe rtyler knows the reason for this on ci.jenkins.io. jenkins.ci has no windows nodes configured.

            The Jenkinsfile in remoting builds on both platforms (but isn't hooked up to anything)

            teilo James Nord added a comment - - edited slide_o_mix - note that https://ci.jenkins.io/job/Core_Folder/job/jenkins_master and https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/ are currently FreeStyle jobs, maybe rtyler knows the reason for this on ci.jenkins.io. jenkins.ci has no windows nodes configured. The Jenkinsfile in remoting builds on both platforms (but isn't hooked up to anything)
            slide_o_mix Alex Earl added a comment -

            In talking to rtyler on IRC yesterday, there are windows nodes available and the Jenkinsfile is in use at least on some build system.

            slide_o_mix Alex Earl added a comment - In talking to rtyler on IRC yesterday, there are windows nodes available and the Jenkinsfile is in use at least on some build system.
            rtyler R. Tyler Croy added a comment - Mmmmm Jenkinsfile https://ci.jenkins.io/job/Core/job/jenkins/
            danielbeck Daniel Beck added a comment - https://github.com/jenkins-infra/documentation/blob/03ef2277047fd93d8dc882f8c7a0b32dc76fb99e/ci.adoc#node-labels
            teilo James Nord added a comment -

            I ran powershell as an admin (didn't try the part about Local Security Policy yet) and the errors are down to 1

            The tests should have an assumption about symlinks if they require them to pass.
            Not looked at the test but I thought there was a fallback that should work for this situation (unless the test is explicitly testing the symlink bit).

            OT: I'm paranoid and the MS doc has a big fat warning "Symbolic links can expose security vulnerabilities in applications that aren't designed to handle them" And whilst I am a trusted user, I do not trust all of my applications to do the right thing

            Anyway - thanks for looking into this slide_o_mix

            teilo James Nord added a comment - I ran powershell as an admin (didn't try the part about Local Security Policy yet) and the errors are down to 1 The tests should have an assumption about symlinks if they require them to pass. Not looked at the test but I thought there was a fallback that should work for this situation (unless the test is explicitly testing the symlink bit). OT: I'm paranoid and the MS doc has a big fat warning "Symbolic links can expose security vulnerabilities in applications that aren't designed to handle them" And whilst I am a trusted user, I do not trust all of my applications to do the right thing Anyway - thanks for looking into this slide_o_mix
            batmat Baptiste Mathus made changes -
            Remote Link Cette demande est liée à "PR-2690 on Core (Lien Web)" [ 15172 ]

            Filed https://github.com/jenkinsci/jenkins/pull/2689 against the Jenkinsfile to also build the core on Windows.

            batmat Baptiste Mathus added a comment - Filed https://github.com/jenkinsci/jenkins/pull/2689 against the Jenkinsfile to also build the core on Windows.

            teilo Working on ^ I saw there's actually a few failures in the test module of the core. Can you run it too and confirm? (I'm saying "a few" because 60+ is quite high, but still small compared to 9173 ).
            Thanks

            19:03:20 [windows] Tests run: 9173, Failures: 53, Errors: 11, Skipped: 34, Flakes: 3
            19:03:20 [windows] 
            19:03:20 [windows] [ERROR] There are test failures.
            
            batmat Baptiste Mathus added a comment - teilo Working on ^ I saw there's actually a few failures in the test module of the core. Can you run it too and confirm? (I'm saying "a few" because 60+ is quite high, but still small compared to 9173 ). Thanks 19:03:20 [windows] Tests run: 9173, Failures: 53, Errors: 11, Skipped: 34, Flakes: 3 19:03:20 [windows] 19:03:20 [windows] [ERROR] There are test failures.

            Created JENKINS-40746 to followup on the failures on that module and not mix discussions (though there's still probably a link).

            batmat Baptiste Mathus added a comment - Created JENKINS-40746 to followup on the failures on that module and not mix discussions (though there's still probably a link).
            batmat Baptiste Mathus made changes -
            Link This issue is related to JENKINS-40746 [ JENKINS-40746 ]

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/test/java/hudson/model/RunTest.java
            http://jenkins-ci.org/commit/jenkins/5483ee13833bb44ff611e8da3a8c74379ba26e11
            Log:
            Merge pull request #2690 from batmat/fix-windows-build

            JENKINS-40290 Fix test failing on Windows because of line feed assumption

            Compare: https://github.com/jenkinsci/jenkins/compare/6f9837683905...5483ee13833b

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/test/java/hudson/model/RunTest.java http://jenkins-ci.org/commit/jenkins/5483ee13833bb44ff611e8da3a8c74379ba26e11 Log: Merge pull request #2690 from batmat/fix-windows-build JENKINS-40290 Fix test failing on Windows because of line feed assumption Compare: https://github.com/jenkinsci/jenkins/compare/6f9837683905...5483ee13833b
            teilo James Nord added a comment -

            @batmat not when I ran it (but make sure you use -Dconcurrency=1 otherwise you have a whole slew of random garbage JENKINS-37177)

            I will run again.

            teilo James Nord added a comment - @batmat not when I ran it (but make sure you use -Dconcurrency=1 otherwise you have a whole slew of random garbage JENKINS-37177 ) I will run again.
            slide_o_mix Alex Earl added a comment -

            Hasn't this been resolved now?

            slide_o_mix Alex Earl added a comment - Hasn't this been resolved now?
            teilo James Nord added a comment -

            slide_o_mix a lot of the tests where "fixed" by ignoring them on windows. https://ci.jenkins.io/job/Core/job/jenkins/job/master/510/testReport/hudson.model/JobTest/testDoNotAutoTrimExistingUntrimmedNames/

            So in one way yes the tests no longer fail - but in another way no - no as there are currently 103 skipped tests and I would guess a large proportion of them are assumeFalse("not on windows" , Functions.isWindows())

            teilo James Nord added a comment - slide_o_mix a lot of the tests where "fixed" by ignoring them on windows. https://ci.jenkins.io/job/Core/job/jenkins/job/master/510/testReport/hudson.model/JobTest/testDoNotAutoTrimExistingUntrimmedNames/ So in one way yes the tests no longer fail - but in another way no - no as there are currently 103 skipped tests and I would guess a large proportion of them are assumeFalse("not on windows" , Functions.isWindows())

            People

              Unassigned Unassigned
              teilo James Nord
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: