@@ -136,7 +136,13 @@ withApp settings app f = do
137 (forkIO $ runSettings settings' app `onException` putMVar baton ())
137 (forkIO $ runSettings settings' app `onException` putMVar baton ())
138 killThread
138 killThread
139− (const $ takeMVar baton >> f port)
140+ takeMVar baton
141+ -- use timeout to make sure we don't take too long
142+ mres <- timeout (60 * 1000 * 1000) (f port)
144+ Nothing -> error "Timeout triggered, too slow!"
141runTest :: Int -- ^ expected number of requests
147runTest :: Int -- ^ expected number of requests
142 -> CounterApplication
148 -> CounterApplication