[LU-9474] tests: register traps in a correct order Created: 09/May/17 Updated: 05/Aug/20 Resolved: 06/Aug/18 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.12.0, Lustre 2.10.7 |
| Type: | Bug | Priority: | Minor |
| Reporter: | CEA | Assignee: | Saurabh Tandan (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 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.
|
| Comments |
| Comment by James Nunez (Inactive) [ 09/May/17 ] |
|
Saurabh - Quentin started work on this issue with https://review.whamcloud.com/#/c/26734/. Would you please work with him to make sure that this work lands to master? Thanks, James |
| Comment by Andreas Dilger [ 16/May/17 ] |
|
I'm not sure why you think the "call trap 0 at start of trap function", "call trap function at end of test" is bad? That consolidates cleanup code that may be in the trap function, rather than duplicating it at the end of the test and ensures that the trap is cleared for this test. AFAIK, there is not yet a "trap 0" at the end of run_tests() though that is probably a good idea. |
| Comment by Quentin Bouget [ 16/May/17 ] |
|
Ultimately, the test is launched in run_one() which itself is called inside a subshell in run_one_logged(), so traps defined inside a test function should not leak to other tests and EXIT traps are already executed at the end of tests. |
| Comment by Gerrit Updater [ 17/Oct/17 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/29653 |
| Comment by Gerrit Updater [ 15/Nov/17 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30097 |
| Comment by Gerrit Updater [ 15/Nov/17 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30098 |
| Comment by Gerrit Updater [ 22/Nov/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/29653/ |
| Comment by Gerrit Updater [ 05/Dec/17 ] |
|
James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/30371 |
| Comment by Gerrit Updater [ 12/Dec/17 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30490 |
| Comment by Gerrit Updater [ 17/Dec/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30097/ |
| Comment by Gerrit Updater [ 19/Dec/17 ] |
|
John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30371/ |
| Comment by Gerrit Updater [ 09/Feb/18 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30490/ |
| Comment by Gerrit Updater [ 27/Feb/18 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/31429 |
| Comment by Gerrit Updater [ 21/May/18 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31429/ |
| Comment by Gerrit Updater [ 06/Aug/18 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/30098/ |
| Comment by Peter Jones [ 06/Aug/18 ] |
|
Looks like this work has all landed now |
| Comment by Gerrit Updater [ 01/Feb/19 ] |
|
Jian Yu (yujian@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34158 |
| Comment by Gerrit Updater [ 15/Feb/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34158/ |