class TestLimiter
Defined at line 208 of file ../../zircon/system/utest/core/vmo/helpers.h
There are a few tests in this suite which attempt to perform a _large_ number
of iterations of the test, typically looking for something like a race
condition regression. This can lead to problems in some worst case
scenarios. If the test is running in non KVM assisted emulation (as it would
on RISC-V, currently), and the test harness machine is very overloaded
(something which does happen, unfortunately), it is possible for a test to
not be able to perform its 1000 (for example) iterations before timing out,
even if everything is working correctly.
Since these tests tend to be looking for non-deterministic repros of races in
the case of regression, there really is no good number of iterations to pick
here. 1000 is a lot, but it does not mean that the test is guaranteed to
catch a regression (there is no number large enough to guarantee that). This
said, in worst case scenarios, the test can end up timing out and generating
flake.
So, add a small helper class in an attempt to balance these two issues. We'd
_like_ to run the test through X cycles, but if it is taking longer than Y
second to do so, we should probably simply print a warning call the test
done early. This way, we are still getting a lot of iterations in CI/CQ, but
hopefully not causing any false positive flake when things are not running
quickly in the test environment.
Public Methods
void TestLimiter (uint32_t iterations, zx::duration time_limit)
Defined at line 210 of file ../../zircon/system/utest/core/vmo/helpers.h
void ~TestLimiter ()
Defined at line 212 of file ../../zircon/system/utest/core/vmo/helpers.h
void TestLimiter (const TestLimiter & )
Defined at line 214 of file ../../zircon/system/utest/core/vmo/helpers.h
TestLimiter & operator= (const TestLimiter & )
Defined at line 215 of file ../../zircon/system/utest/core/vmo/helpers.h
void TestLimiter (TestLimiter && )
Defined at line 216 of file ../../zircon/system/utest/core/vmo/helpers.h
TestLimiter & operator= (TestLimiter && )
Defined at line 217 of file ../../zircon/system/utest/core/vmo/helpers.h
uint32_t iteration ()
Defined at line 219 of file ../../zircon/system/utest/core/vmo/helpers.h
void next ()
Defined at line 220 of file ../../zircon/system/utest/core/vmo/helpers.h
bool Finished ()
Defined at line 222 of file ../../zircon/system/utest/core/vmo/helpers.h