Adds retry for assertions of metrics and account balances.
This commit is contained in:
parent
44e237e60e
commit
9328f04f4a
|
@ -1,5 +1,4 @@
|
|||
using DistTestCore.Codex;
|
||||
using Logging;
|
||||
using NUnit.Framework;
|
||||
using NUnit.Framework.Constraints;
|
||||
using System.Numerics;
|
||||
|
@ -98,7 +97,10 @@ namespace DistTestCore.Marketplace
|
|||
|
||||
public void AssertThatBalance(IResolveConstraint constraint, string message = "")
|
||||
{
|
||||
Assert.That(GetBalance(), constraint, message);
|
||||
Time.Retry(() =>
|
||||
{
|
||||
Assert.That(GetBalance(), constraint, message);
|
||||
}, nameof(AssertThatBalance));
|
||||
}
|
||||
|
||||
public TestToken GetBalance()
|
||||
|
|
|
@ -28,12 +28,15 @@ namespace DistTestCore.Metrics
|
|||
|
||||
public void AssertThat(string metricName, IResolveConstraint constraint, string message = "")
|
||||
{
|
||||
var metricSet = GetMetricWithTimeout(metricName);
|
||||
var metricValue = metricSet.Values[0].Value;
|
||||
Time.Retry(() =>
|
||||
{
|
||||
var metricSet = GetMetricWithTimeout(metricName);
|
||||
var metricValue = metricSet.Values[0].Value;
|
||||
|
||||
log.Log($"{node.Name} metric '{metricName}' = {metricValue}");
|
||||
log.Log($"{node.Name} metric '{metricName}' = {metricValue}");
|
||||
|
||||
Assert.That(metricValue, constraint, message);
|
||||
Assert.That(metricValue, constraint, message);
|
||||
}, nameof(AssertThat));
|
||||
}
|
||||
|
||||
public Metrics? GetAllMetrics()
|
||||
|
|
Loading…
Reference in New Issue