Skip to content

Commit

Permalink
try to add timeout to hanging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Jul 24, 2017
1 parent 97d06ed commit 846831b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/Paket.Tests/Resolver/ResolverErrorSituationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ let graph1 =
]

[<Test>]
[<Timeout 5000>]
let ``should fallback to timeoutexception when task never cancels``() =
use consoleTrace = Logging.event.Publish |> Observable.subscribe Logging.traceToConsole
let config = """
Expand Down Expand Up @@ -258,6 +259,7 @@ let ``task priorization works``() =
cts.Cancel()

[<Test>]
[<Timeout 5000>]
let ``cancellation fsharp.core``() =

let StartCatchCancellation cancellationToken (work) =
Expand Down Expand Up @@ -306,11 +308,13 @@ let ``cancellation fsharp.core``() =
|> ignore
} |> Async.Start

t.Wait(1000)
|> shouldEqual true
()
try
let res = t.Wait(1000)
Assert.Fail (sprintf "Excepted TimeoutException wrapped in an AggregateException, but got %A" res)
with :? AggregateException as agg -> ()

[<Test>]
[<Timeout 5000>]
let ``cancellation WorkerQueue``() =
use cts = new CancellationTokenSource()
let workerQueue = ResolverRequestQueue.Create()
Expand Down

0 comments on commit 846831b

Please sign in to comment.