Skip to content

Commit

Permalink
Fix test RU limits
Browse files Browse the repository at this point in the history
  • Loading branch information
ylibrach authored and bartelink committed Feb 19, 2020
1 parent 7497f96 commit 988a0b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Equinox.Cosmos/Cosmos.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

[<AutoData(SkipIfRequestedViaEnvironmentVariable="EQUINOX_INTEGRATION_SKIP_COSMOS")>]
let ``get Lazy`` (TestStream streamName) = Async.RunSynchronously <| async {
Expand All @@ -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 *)
Expand All @@ -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
}

[<AutoData(SkipIfRequestedViaEnvironmentVariable="EQUINOX_INTEGRATION_SKIP_COSMOS")>]
Expand Down Expand Up @@ -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
}
verifyRequestChargesMax 6 // 5.76 // WAS 4 // 3.04 // WAS 3 // 2.98
}

0 comments on commit 988a0b4

Please sign in to comment.