testing: add -failfast to stop after first test failure #21700
I propose we add a testing flag to cause
There are two cases where I've wanted such a flag:
In the presence of t.Parallel this gets a little trickier. I suggest handling it by collecting the parallel results as they arrive and then exiting after the first failure, printing only the results that came in before the failure and then the failure last, but not printing results that arrived after the failure. The main subtlety for the user is that they might see output logged from other parallel tests which don't have success/failure printouts, but that seems like a minor concern.
You could have a single test function and use subtests and then check if one failed and don't run the rest.