Please sign in to comment.
benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero duration being used as a denominator in benchmark tests. This would almost certainly never happen in real benchmarks. It is only likely in very short benchmarks like the type we run in our test suite to just make sure that the benchmark code is runnable. So, if the environment variable that we use in tests to indicate "allow ludicrously short benchmarks" is set, convert a zero duration for a benchmark to 1 nano-second. PR-URL: #13110 Fixes: #13102 Fixes: #12433 Reviewed-By: Refael Ackermann <firstname.lastname@example.org> Reviewed-By: Ben Noordhuis <email@example.com> Reviewed-By: Joyee Cheung <firstname.lastname@example.org>
- Loading branch information...