Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-8959

TestUserGroupInformation fails on Windows due to "id" executable not found

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • trunk-win
    • trunk-win
    • security
    • None
    • Reviewed

    Description

      TestUserGroupInformation.testGetServerSideGroups contains a hard-coded call to "id", which isn't present on Windows.

      Attachments

        Issue Links

          Activity

            cnauroth Chris Nauroth added a comment -

            This likely just involves merging in a fix in TestUserGroupInformation.java from branch-1-win.

            testGetServerSideGroups(org.apache.hadoop.security.TestUserGroupInformation)  Time elapsed: 109 sec  <<< ERROR!
            java.io.IOException: Cannot run program "id": CreateProcess error=2, The system cannot find the file specified
            	at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
            	at java.lang.Runtime.exec(Runtime.java:593)
            	at java.lang.Runtime.exec(Runtime.java:431)
            	at java.lang.Runtime.exec(Runtime.java:328)
            	at org.apache.hadoop.security.TestUserGroupInformation.testGetServerSideGroups(TestUserGroupInformation.java:120)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            	at java.lang.reflect.Method.invoke(Method.java:597)
            	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
            	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
            	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
            	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
            	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
            	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
            	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
            	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
            	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
            	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
            	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
            	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
            	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
            	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
            	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
            	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
            	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            	at java.lang.reflect.Method.invoke(Method.java:597)
            	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
            	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
            	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
            	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
            	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
            Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
            	at java.lang.ProcessImpl.create(Native Method)
            	at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
            	at java.lang.ProcessImpl.start(ProcessImpl.java:30)
            	at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
            	... 34 more
            
            cnauroth Chris Nauroth added a comment - This likely just involves merging in a fix in TestUserGroupInformation.java from branch-1-win. testGetServerSideGroups(org.apache.hadoop.security.TestUserGroupInformation) Time elapsed: 109 sec <<< ERROR! java.io.IOException: Cannot run program "id" : CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang. Runtime .exec( Runtime .java:593) at java.lang. Runtime .exec( Runtime .java:431) at java.lang. Runtime .exec( Runtime .java:328) at org.apache.hadoop.security.TestUserGroupInformation.testGetServerSideGroups(TestUserGroupInformation.java:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) at java.lang.ProcessImpl.start(ProcessImpl.java:30) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 34 more
            cnauroth Chris Nauroth added a comment -

            This patch merges in the fix that was already submitted on branch-1-win. I've verified that the tests pass on Mac and Windows.

            Please credit this patch to the original authors: Chuan Liu and Bikas Saha. I'm just merging the code.

            cnauroth Chris Nauroth added a comment - This patch merges in the fix that was already submitted on branch-1-win. I've verified that the tests pass on Mac and Windows. Please credit this patch to the original authors: Chuan Liu and Bikas Saha. I'm just merging the code.
            chuanliu Chuan Liu added a comment -

            +1

            Chris, thanks for merging the code! Change looks good.

            chuanliu Chuan Liu added a comment - +1 Chris, thanks for merging the code! Change looks good.

            +1 for the patch. I have committed this to branch-trunk-win.

            Thank you Bikas and Chuan for the patch. Thank you Chris for porting it from branch-1-win.

            sureshms Suresh Srinivas added a comment - +1 for the patch. I have committed this to branch-trunk-win. Thank you Bikas and Chuan for the patch. Thank you Chris for porting it from branch-1-win.

            People

              cnauroth Chris Nauroth
              cnauroth Chris Nauroth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: