context: deflake time-sensitive tests
context: deflake time-sensitive tests

Many of tests in this package assumed reasonable scheduling latency.
Unfortunately, scheduling latency on builders and CI systems is not
always reasonable.

Rather than expecting that a timeout is detected within a fixed short
interval, we can use (*testing.T).Deadline to portably scale the time
we're willing to wait to something appropriate to the builder.

Some of the tests also included arbitrary-duration sleeps, which are
no longer needed after CL 196521; we can remove those instead of
extending them.

Promptness of timeouts is also an important property, but testing that
property is better suited to benchmarks than to tests proper: unlike
tests, we generally expect benchmarks to be run in a quiet,
low-contention environment.

Fixes #13956

Change-Id: I0797e2267fb778c8ad94add56d797de9e2c885e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/223019
Run-TryBot: Bryan C. Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

akutz/go,akutz/go,CAFxX/go,nawawi/go,CAFxX/go,cloudflare/go,nawawi/go,cloudflare/go,golang/go,CAFxX/go,nawawi/go,golang/go,cloudflare/go,CAFxX/go,CAFxX/go,nawawi/go,cloudflare/go,cloudflare/go,akutz/go,akutz/go,nawawi/go,golang/go,cloudflare/go,cloudflare/go,akutz/go,akutz/go,cloudflare/go,golang/go,nawawi/go,CAFxX/go,golang/go,golang/go,nawawi/go,CAFxX/go,CAFxX/go,golang/go,nawawi/go,golang/go,akutz/go,akutz/go