From 988a0b4658b2c5416a5bd48f22da78f8485fc6b1 Mon Sep 17 00:00:00 2001 From: Yaron Librach Date: Tue, 18 Feb 2020 13:50:35 -0500 Subject: [PATCH] Fix test RU limits --- src/Equinox.Cosmos/Cosmos.fs | 2 +- .../CosmosCoreIntegration.fs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Equinox.Cosmos/Cosmos.fs b/src/Equinox.Cosmos/Cosmos.fs index 8b2c68858..334653586 100644 --- a/src/Equinox.Cosmos/Cosmos.fs +++ b/src/Equinox.Cosmos/Cosmos.fs @@ -359,7 +359,7 @@ module private MicrosoftAzureCosmosWrappers = type Azure.Core.ResponseHeaders with member headers.GetRequestCharge () = match headers.TryGetValue("x-ms-request-charge") with - | true, charge -> float charge + | true, charge when not <| String.IsNullOrEmpty charge -> float charge | _ -> 0. type Azure.Cosmos.CosmosContainer with diff --git a/tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs b/tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs index 1e0e7c292..e7e726e9d 100644 --- a/tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs +++ b/tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs @@ -238,7 +238,7 @@ type Tests(testOutputHelper) = // 2 items atm test <@ [EqxAct.ResponseForward; EqxAct.ResponseForward; EqxAct.QueryForward] = capture.ExternalCalls @> - verifyRequestChargesMax 6 } // 5.77 + verifyRequestChargesMax 9 } // 8.51 // WAS 6 // 5.77 [] let ``get Lazy`` (TestStream streamName) = Async.RunSynchronously <| async { @@ -258,7 +258,7 @@ type Tests(testOutputHelper) = | _ -> None // validate that, despite only requesting max 1 item, we only needed one trip (which contained only one item) [1,1] =! capture.ChooseCalls queryRoundTripsAndItemCounts - verifyRequestChargesMax 4 // 3.02 // WAS 3 // 2.97 + verifyRequestChargesMax 6 // 5.74 // WAS 4 // 3.02 // WAS 3 // 2.97 } (* Backward *) @@ -279,7 +279,7 @@ type Tests(testOutputHelper) = verifyCorrectEventsBackward 4L expected res test <@ [EqxAct.ResponseBackward; EqxAct.QueryBackward] = capture.ExternalCalls @> - verifyRequestChargesMax 4 // 3.04 // WAS 3 + verifyRequestChargesMax 6 // 5.75 // WAS 4 // 3.04 // WAS 3 } [] @@ -323,5 +323,5 @@ type Tests(testOutputHelper) = | EqxEvent (Equinox.Cosmos.Store.Log.Event.Query (Equinox.Cosmos.Store.Direction.Backward, responses, { count = c })) -> Some (responses,c) | _ -> None [1,5] =! capture.ChooseCalls queryRoundTripsAndItemCounts - verifyRequestChargesMax 4 // 3.04 // WAS 3 // 2.98 - } \ No newline at end of file + verifyRequestChargesMax 6 // 5.76 // WAS 4 // 3.04 // WAS 3 // 2.98 + }