Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-10234

tests: sanity-hsm: tests 34,35,36 are not using wait correctly

Details

    • 3
    • 9223372036854775807

    Description

      All those tests launch a command in the background and want to check whether or not the command completes, they do so like this:

      test_3*()
      {
          ...
          md5sum $f > /dev/null &
          local pid=$!
          ...
          local rc=$(wait $pid)
          [[ $rc -eq 0 ]] || error "..."
      }
      

      Putting aside the fact that launching wait in a subshell like this will not work (pid 12345 is not a child of this shell), local rc=$(command) is not the way to check a return code in bash.

      This code should be replaced with:

      test_3*()
      {
          ...
          md5sum $f > /dev/null &
          local pid=$!
          ...
          wait $pid || error "..."
      }
      

      Attachments

        Activity

          [LU-10234] tests: sanity-hsm: tests 34,35,36 are not using wait correctly

          John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30208/
          Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3[4-6]
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set:
          Commit: ef3252dc74e962dd7c81e09ca6b4b49273275b59

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30208/ Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3 [4-6] Project: fs/lustre-release Branch: b2_10 Current Patch Set: Commit: ef3252dc74e962dd7c81e09ca6b4b49273275b59

          James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/30208
          Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3[4-6]
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: edb1c83170db6bc699c33b6bd8be9771483b8987

          gerrit Gerrit Updater added a comment - James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/30208 Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3 [4-6] Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: edb1c83170db6bc699c33b6bd8be9771483b8987
          pjones Peter Jones added a comment -

          Landed for 2.11

          pjones Peter Jones added a comment - Landed for 2.11

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30102/
          Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3[4-6]
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: eec4b8985f5eaacd13f0e0db7328dcdd610655bc

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30102/ Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3 [4-6] Project: fs/lustre-release Branch: master Current Patch Set: Commit: eec4b8985f5eaacd13f0e0db7328dcdd610655bc

          Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30102
          Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3[4-6]
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 52b79ef846dcdf8740a0c15669f63ce514176a71

          gerrit Gerrit Updater added a comment - Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30102 Subject: LU-10234 tests: use wait correctly in sanity-hsm test_3 [4-6] Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 52b79ef846dcdf8740a0c15669f63ce514176a71

          Yes =)

          Quentin

          bougetq Quentin Bouget (Inactive) added a comment - Yes =) Quentin
          pjones Peter Jones added a comment -

          Quentin

          Will you be pushing a patch to correct this?

          Peter

          pjones Peter Jones added a comment - Quentin Will you be pushing a patch to correct this? Peter

          People

            bougetq Quentin Bouget (Inactive)
            cealustre CEA
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: