Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
more tolerance on messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Oct 25, 2018
1 parent 2854c14 commit 452b2e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/CallPolly.Tests/RulesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,10 @@ type Cutoff(output : Xunit.Abstractions.ITestOutputHelper) =
| x -> failwithf "Unexpected event %A" x
let breached,wouldBeCancelled = evnts |> Seq.map breachedOrCanceled |> Choice.partition
// even the zero delay ones could in extreme circumstances end up with wierd timing effects
test <@ between 0 4 <| Array.length breached // should be = 2, but we'll settle for this weaker assertion
&& between 1 4 <| Array.length wouldBeCancelled @> } // should be = 2, but we'll settle for this weaker assertion
test <@ let breached,wouldBeCancelled = Array.length breached, Array.length wouldBeCancelled
between 0 4 <| breached // should be = 2, but we'll settle for this weaker assertion
&& between 1 5 <| wouldBeCancelled
&& between 6 6 <| breached + wouldBeCancelled @> }

let [<Fact>] ``when active, cooperatively cancels requests exceeding the cutoff duration`` () = async {
let pol = Parser.parse(defs).CreatePolicy log
Expand Down

0 comments on commit 452b2e4

Please sign in to comment.