From d930f9773d0c68ca805acfb3cd93f15285c93ef7 Mon Sep 17 00:00:00 2001 From: Steven He Date: Sat, 20 Apr 2024 13:19:03 +0900 Subject: [PATCH] Fix invalid assert --- .../PrometheusCollectionManagerTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs index fd11655005..b64779eebf 100644 --- a/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs +++ b/test/OpenTelemetry.Exporter.Prometheus.HttpListener.Tests/PrometheusCollectionManagerTests.cs @@ -88,7 +88,11 @@ public async Task EnterExitCollectTest(int scrapeResponseCacheDurationMillisecon // This should use the cache and ignore the second counter update. var task = exporter.CollectionManager.EnterCollect(); - Assert.True(task.IsCompleted); + if (cacheEnabled) + { + Assert.True(task.IsCompleted); + } + var response = await task; try {