Fix re-evaluation of condition in `Time.WaitUntil`

For example, seller.Marketplace.GetBalance() is captured once on call, and then is compared to a continually updated sellerWithFailures.Marketplace.GetBalance.

Update RetryAssert such that `var c = constraint.Resolve();` is executed inside of the `Time.WaitUntil` instead of outside, so it is continually reevaluated.
This commit is contained in:
Eric 2023-09-14 14:45:25 +10:00
parent ef2c18c599
commit 0d9aa230da
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -10,8 +10,11 @@ namespace DistTestCore.Helpers
{
try
{
var c = constraint.Resolve();
Time.WaitUntil(() => c.ApplyTo(actual()).IsSuccess);
Time.WaitUntil(() => {
var c = constraint.Resolve();
return c.ApplyTo(actual()).IsSuccess;
});
}
catch (TimeoutException)
{