holochain-proto
holochain-proto copied to clipboard
add a `waitUntil()` style function for tests
Lots of flaky tests happening at the moment.
e.g. https://github.com/holochain/holochain-proto/pull/683
Typically takes 3-4 tries to get tests through Travis.
One simple approach that might help things is to standardise a way to wait until a predicate is satisfied rather than waiting an exact time.
Nice, yes we should definitely clean things up with this pattern.
i'm doing some googling to see if there's a way to directly observe value changes of variables with events/callbacks in go
ideal: when(pred, timeout)
maybe OK: waitUntil(pred, timeout)
will frequently break: waitFor(pred, ms)
so as per https://github.com/holochain/holochain-proto/pull/689/files when
could look like when(pass-pred, error-pred, chan)