[roll] Roll fuchsia [subprocess] Return ctx.Err() if context cancelled

If the context is cancelled while a command is running, we should return
the context error after cleaning up instead of returning the ExitError
returned by Cmd.Wait() after it gets SIGTERMed. This makes it much
easier for the caller to determine if the subprocess failed to due a
context cancellation or because of an internal failure within the
subprocess.

Notably, this will make it easier for testrunner to determine if a
subprocess test fails due to a timeout or due to an internal failure,
and classify the test failure correctly as a timeout or generic failure.

I also simplified the subprocess runner code in a couple ways:
- Move the cleanup logic into the main thread and run `Cmd.Wait()` in a
  goroutine instead of the reverse. This means less state that has to be
  passed around between functions.
- Because the cleanup logic is now synchronous in relation to starting
  the command, we don't run the cleanup logic unless the command has
  definitely been started, so we don't need to use a mutex to safely
  check if the process has been started.

I tried to avoid introducing any changes to the behavior of how the
runner starts and cleans up subprocesses; the only functional difference
should be the return value of Run().

Original-Bug: 49266
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/632265
Original-Revision: 55631efdb0b9a1c884d0c05148b1d10d1ed9f595
GitOrigin-RevId: 21dac0c83e0160598284b561ef1b4ba00aa83b36
Change-Id: I6cc37e5e74e3d49be2166043db4415d6edc1f6d9
1 file changed
tree: 4faace2e3d42d254237ea7d87463c1ed71d2def4
  1. infra/
  2. third_party/
  3. cts
  4. firmware
  5. flower
  6. jiri.lock
  7. minimal
  8. prebuilts
  9. README.md
  10. stem
  11. test_durations
  12. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.