We are currently using the Google log CHECK macros (CHECK_SOME,
CHECK_NOTNULL etc) in the test harness, usually to verify test setup. When
these checks fail, it causes the test harness to abort rather than simply
move onto the next test. The abort prevents any subsequent tests from
running, hiding errors and preventing the generation of the XML test report.
I would like to propose that we eliminate the use of CHECK in the test
harness and replace it with the appropriate Google test macros to fail the
test case.
I
am not proposing that we change the use of CHECK outside the test harness
(although CHECK calls in master and slave can also kill the test harness).
For void functions, CHECK can
easily
be replaced with the corresponding ASSERT equivalent.
For non-void function, ASSERT cannot be used because it does not return the
correct data type and hence we need to use a combination of ADD_FAILURE()
and return.
For example:
CHECK(foo)
would become:
if(!foo) {
ADD_FAILURE();
return anything;
}
If there is general agreement, I will raise tickets to update the Mesos
testing patterns document and each of the test cases.
Thanks
-- Paul Brett