The testing package's T.Parallel method resets the time of the test so that it's as if the test starts just before the method returns. The reason for doing this is that it's likely the first call made from the testing function. This is reasonable, but I suggest that this behavior be documented. The source is here.
The text was updated successfully, but these errors were encountered:
Before, we reset the timer at the end of T.Parallel, which is okay
assuming that T.Parallel is the first thing in the test.
Snapshot the elapsed time at the beginning of Parallel and include it in
the total duration so that any time spent in the test before calling
Parallel is reported in the test duration as well.
Reviewed-by: Russ Cox <firstname.lastname@example.org>