diff --git a/DistTestCore/Marketplace/MarketplaceAccess.cs b/DistTestCore/Marketplace/MarketplaceAccess.cs index 33f68e6..ad9bc7a 100644 --- a/DistTestCore/Marketplace/MarketplaceAccess.cs +++ b/DistTestCore/Marketplace/MarketplaceAccess.cs @@ -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() diff --git a/DistTestCore/Metrics/MetricsAccess.cs b/DistTestCore/Metrics/MetricsAccess.cs index e52c175..2032839 100644 --- a/DistTestCore/Metrics/MetricsAccess.cs +++ b/DistTestCore/Metrics/MetricsAccess.cs @@ -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()