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

tests: register traps in a correct order

Details

    • 3
    • 9223372036854775807

    Description

      trap is used in many tests to set actions to perform on cleanup.

      IMHO, trap should be registered in this order:

      cleanup_test_XX()
      {
          undo_something
      }
      
      test_XX()
      {
          trap cleanup_test_XX EXIT
          do_something
          ...
      }
      

      Currently many tests do not respect this template.
      Among those, some:

      • register the trap after do_something();
      • explicitly call cleanup_test_XX() at the end of the test;
      • call trap 0 at the start of cleanup_test_XX() (this one may be controversial, I believe the test harness should provide, and probably already provides, trap isolation between tests).

      Attachments

        Issue Links

          Activity

            [LU-9474] tests: register traps in a correct order
            pjones Peter Jones made changes -
            Reporter Original: Quentin Bouget [ bougetq ] New: CEA [ cealustre ]
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.10.7 [ 14401 ]
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.12.0 [ 13495 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            pjones Peter Jones made changes -
            Labels Original: LTS patch New: patch
            bougetq Quentin Bouget (Inactive) made changes -
            Link New: This issue is related to LU-9475 [ LU-9475 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-10461 [ LU-10461 ]
            bougetq Quentin Bouget (Inactive) made changes -
            Attachment New: tests_stack_trap.bash [ 28905 ]
            mdiep Minh Diep made changes -
            Labels Original: patch New: LTS patch
            pjones Peter Jones made changes -
            Link Original: This issue is related to JFC-10 [ JFC-10 ]
            mdiep Minh Diep made changes -
            Link New: This issue is related to JFC-10 [ JFC-10 ]

            People

              standan Saurabh Tandan (Inactive)
              cealustre CEA
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: