Skip to content

Commit

Permalink
Adjust Cosmos RU tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Aug 15, 2019
1 parent 864dc35 commit d99e0d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/Equinox.Cosmos.Integration/CosmosCoreIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Tests(testOutputHelper) =
let! res = Events.append ctx streamName index <| TestEvents.Create(0,1)
test <@ AppendResult.Ok 1L = res @>
test <@ [EqxAct.Append] = capture.ExternalCalls @>
verifyRequestChargesMax 31 // 30.44 // WAS 10
verifyRequestChargesMax 35 // 31.3 // WAS 10
// Clear the counters
capture.Clear()

Expand Down Expand Up @@ -122,7 +122,7 @@ type Tests(testOutputHelper) =
test <@ [EqxAct.Append] = capture.ExternalCalls @>
pos <- pos + int64 appendBatchSize
pos =! res
verifyRequestChargesMax 44 // 43.58 observed
verifyRequestChargesMax 46 // 44.07 observed
capture.Clear()

let! res = Events.getNextIndex ctx streamName
Expand Down Expand Up @@ -150,12 +150,12 @@ type Tests(testOutputHelper) =
let extrasCount = match extras with x when x > 50 -> 5000 | x when x < 1 -> 1 | x -> x*100
let! _pos = ctx.NonIdempotentAppend(stream, TestEvents.Create (int pos,extrasCount))
test <@ [EqxAct.Append] = capture.ExternalCalls @>
verifyRequestChargesMax 441 // 440 observed
verifyRequestChargesMax 300 // 251.39 observed
capture.Clear()

let! pos = ctx.Sync(stream,?position=None)
test <@ [EqxAct.Tip] = capture.ExternalCalls @>
verifyRequestChargesMax 50 // 41 observed // for a 200, you'll pay a lot (we omitted to include the position that NonIdempotentAppend yielded)
verifyRequestChargesMax 45 // 41 observed // for a 200, you'll pay a lot (we omitted to include the position that NonIdempotentAppend yielded)
capture.Clear()

let! _pos = ctx.Sync(stream,pos)
Expand Down Expand Up @@ -183,7 +183,7 @@ type Tests(testOutputHelper) =
let! res = Events.append ctx streamName 0L expected
test <@ AppendResult.Ok 1L = res @>
test <@ [EqxAct.Append] = capture.ExternalCalls @>
verifyRequestChargesMax 30 // 29.68 WAS 11 // 10.33
verifyRequestChargesMax 32 // 30.42 WAS 11 // 10.33
capture.Clear()

// Try overwriting it (a competing consumer would see the same)
Expand Down
2 changes: 1 addition & 1 deletion tests/Equinox.Cosmos.Integration/CosmosIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type Tests(testOutputHelper) =
| 1 -> 1 // it does cost a single trip to determine there are 0 items
| i -> ceil(float (i-1) * float eventsPerAction / float maxItemsPerRequest / float maxEventsPerBatch) |> int
test <@ List.replicate expectedBatchesOf2Items EqxAct.ResponseBackward @ [EqxAct.QueryBackward; EqxAct.Append] = capture.ExternalCalls @>
verifyRequestChargesMax 44 // 43.54
verifyRequestChargesMax 46 // 44.32
capture.Clear()

// Validate basic operation; Key side effect: Log entries will be emitted to `capture`
Expand Down

0 comments on commit d99e0d9

Please sign in to comment.