Always cancel requests during tearDown

Assertions can terminate a test prior to that test's blockForDone call.
In this case we will try to shutdown the engine with an outstanding
request, in which case the method will throw, effectively failing the
test.

To avoid that, store a reference by the request created by the test and
always cancel it (before calling engine.shutdown()).

Also, instead of asserting the success of the requests, assume it. This
is required because these tests are not hermetic and the request might
fail due to reasons unrelated to the code being tested.

Bug: 267618889
Test: m && atest CtsNetHttpTestCasess
Change-Id: Ia1e30c99303f05342a2a73562e85d4ab2486c0d7
2 files changed