command: fix flaky test

If `exec` times out, we need to wrap the error it died with, rather than
embedding it in another error. This allows
`TestRunWithTimeoutReturnsErrorOnTimeout`'s `errors.Is` to correctly
detect that `err` is a `context.DeadlineExceeded`.

BUG=None
TEST=ran this test 1000x

Change-Id: I69e0dcea25dfd0cb01ac5ec0a2e8ce2f116deff7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3932869
Auto-Submit: George Burgess <gbiv@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
1 file changed