Pig
  1. Pig
  2. PIG-2499

Pig TestGrunt.testShellCommand occasionally fails

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: build
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The following code fails from time to time (with a NPE since fileReader.readLine() returns null) :

                  strCmd = "sh bash -c 'touch TouchedFileInsideGrunt_61 | ls | grep TouchedFileInsideGrunt_61 > fileContainingTouchedFileInsideGruntShell_71'";
                  cmd = new ByteArrayInputStream(strCmd.getBytes());
                  reader = new InputStreamReader(cmd);
                  grunt = new Grunt(new BufferedReader(reader), context);
                  grunt.exec();
                  fileReader = new BufferedReader(new FileReader("fileContainingTouchedFileInsideGruntShell_71"));
                  assertTrue(fileReader.readLine().equals("TouchedFileInsideGrunt_61"));
      
      1. PIG-2499.patch
        0.8 kB
        Tom White

        Activity

        Hide
        Tom White added a comment -

        I wonder if touch TouchedFileInsideGrunt_61 | ls is causing a race, we should probably change it to touch TouchedFileInsideGrunt_61 && ls for safety's sake anyway.

        PIG-2206 was reporting this test as failing too. I don't think it's Mac specific as I have seen this failure on Linux too.

        Show
        Tom White added a comment - I wonder if touch TouchedFileInsideGrunt_61 | ls is causing a race, we should probably change it to touch TouchedFileInsideGrunt_61 && ls for safety's sake anyway. PIG-2206 was reporting this test as failing too. I don't think it's Mac specific as I have seen this failure on Linux too.
        Hide
        Tom White added a comment -

        Trivial patch.

        Show
        Tom White added a comment - Trivial patch.
        Hide
        Daniel Dai added a comment -

        I do see it occasionally as well. Patch committed to trunk. Thanks Tom!

        Show
        Daniel Dai added a comment - I do see it occasionally as well. Patch committed to trunk. Thanks Tom!

          People

          • Assignee:
            Tom White
            Reporter:
            Tom White
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development