I'd like to add 2 primitives to construct interesting race conditions between processes:
wait(name): wait for unblock(name)
unblock(name): unblock current or future wait(name), block until one wait(name) is unblocked.
There does not seem to be a generic/portable way to implement them. But with certain assumptions like $TESTING_TEMP is a directory that can be freely written to for communication, it is possible to implement above feature. This PR adds a way so applications can implement their needs and get the logic exposed via the FAILPOINTS environment variable.
Side note:
It almost seems that there are 2 different use-cases of fail:
Library testing. One can just use cfg, cfg_callback without using the FAILPOINTS environment at all. Different test cases have different failpoint configurations
Application testing. FAILPOINTS is probably used exclusively, since the cfg approach would require compiling the executable to O(test case) different ones, which does not make much sense.
The "callback" flexibility seems exclusive to library testing. This change closes the gap so application testing can get similar flexibility.
See also commit messages.
I'd like to add 2 primitives to construct interesting race conditions between processes:
There does not seem to be a generic/portable way to implement them. But with certain assumptions like
$TESTING_TEMP
is a directory that can be freely written to for communication, it is possible to implement above feature. This PR adds a way so applications can implement their needs and get the logic exposed via theFAILPOINTS
environment variable.Side note:
It almost seems that there are 2 different use-cases of
fail
:cfg
,cfg_callback
without using theFAILPOINTS
environment at all. Different test cases have different failpoint configurationsFAILPOINTS
is probably used exclusively, since thecfg
approach would require compiling the executable to O(test case) different ones, which does not make much sense.The "callback" flexibility seems exclusive to library testing. This change closes the gap so application testing can get similar flexibility.