[LU-10234] tests: sanity-hsm: tests 34,35,36 are not using wait correctly Created: 13/Nov/17 Updated: 05/Aug/20 Resolved: 22/Nov/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.11.0, Lustre 2.10.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | CEA | Assignee: | Quentin Bouget |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Severity: | 3 |
| Rank (Obsolete): | 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 "..."
}
|
| Comments |
| Comment by Peter Jones [ 13/Nov/17 ] |
|
Quentin Will you be pushing a patch to correct this? Peter |
| Comment by Quentin Bouget [ 13/Nov/17 ] |
|
Yes =) Quentin |
| Comment by Gerrit Updater [ 15/Nov/17 ] |
|
Quentin Bouget (quentin.bouget@cea.fr) uploaded a new patch: https://review.whamcloud.com/30102 |
| Comment by Gerrit Updater [ 22/Nov/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30102/ |
| Comment by Peter Jones [ 22/Nov/17 ] |
|
Landed for 2.11 |
| Comment by Gerrit Updater [ 22/Nov/17 ] |
|
James Nunez (james.a.nunez@intel.com) uploaded a new patch: https://review.whamcloud.com/30208 |
| Comment by Gerrit Updater [ 27/Nov/17 ] |
|
John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30208/ |