From a45519eb1c69ccc857d73485a12e73e4540b1664 Mon Sep 17 00:00:00 2001 From: Babatunde Aromire Date: Thu, 27 Jul 2023 09:43:00 +0200 Subject: [PATCH] fix: failing test --- Test/Unit/CDFPusherTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Test/Unit/CDFPusherTest.cs b/Test/Unit/CDFPusherTest.cs index 30f994a1..65774bd2 100644 --- a/Test/Unit/CDFPusherTest.cs +++ b/Test/Unit/CDFPusherTest.cs @@ -997,7 +997,6 @@ public async Task TestCreateRelationships() [Fact] public async Task TestCreateRawRelationships() { - using var extractor = tester.BuildExtractor(true, null, pusher); CommonTestUtils.ResetMetricValue("opcua_node_ensure_failures_cdf"); tester.Config.Cognite.MetadataTargets = new MetadataTargetsConfig @@ -1009,13 +1008,15 @@ public async Task TestCreateRawRelationships() } }; tester.Config.Extraction.Relationships.Enabled = true; + (handler, pusher) = tester.GetCDFPusher(); + using var extractor = tester.BuildExtractor(true, null, pusher); var assets = Enumerable.Empty(); var tss = Enumerable.Empty(); var update = new UpdateConfig(); // Push none - Assert.True((await pusher.PushNodes(assets, tss, Enumerable.Empty(), update, tester.Source.Token)).References); + Assert.True((await pusher.PushNodes(assets, tss, Enumerable.Empty(), update, tester.Source.Token)).RawReferences); // Fail to push var references = new List @@ -1027,9 +1028,9 @@ public async Task TestCreateRawRelationships() handler.FailedRoutes.Add("/raw/dbs/metadata/tables/relationships/rows"); Assert.False((await pusher.PushNodes(assets, tss, references, update, tester.Source.Token)).RawReferences); Assert.Empty(handler.RelationshipsRaw); + handler.FailedRoutes.Clear(); // Push successful - handler.FailedRoutes.Clear(); Assert.True((await pusher.PushNodes(assets, tss, references, update, tester.Source.Token)).RawReferences); Assert.Equal(2, handler.RelationshipsRaw.Count);