Skip to content

Commit

Permalink
inbound-governor: updated tests
Browse files Browse the repository at this point in the history
In the previous commit we improved error handling of threads started by
the server.  Now we don't need to use `Async.link` in the tests to make
sure exceptions are propagated, and some the errors are not longer
wrapped in `ExceptionInLinkedThread`.
  • Loading branch information
coot committed May 6, 2024
1 parent 73ce066 commit 18e92c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2078,12 +2078,9 @@ unit_server_accept_error (Fixed rnd) ioErrType =
noAttenuation { biAcceptFailures = Just (0, ioErrType) }

sim :: IOSim s Property
sim = handle (\e -> return $ case fromException e of
Just (ExceptionInLinkedThread _ err) ->
case fromException err of
Just (_ :: IOError) -> property True
Nothing -> property False
Nothing -> property False
sim = handle (\e -> return $ case fromException e :: Maybe IOError of
Just _ -> property True
Nothing -> property $ counterexample ("not an IOError: " ++ show e) False
)
$ withSnocket nullTracer
bearerAttenuation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,7 @@ unidirectionalExperiment stdGen timeouts snocket makeBearer confSock socket clie
noNextRequests
timeLimitsHandshake
maxAcceptedConnectionsLimit
$ \_ serverAddr serverAsync -> do
link serverAsync
$ \_ serverAddr _serverAsync -> do
-- client → server: connect
(rs :: [Either SomeException (TemperatureBundle [resp])]) <-
replicateM
Expand Down Expand Up @@ -810,8 +809,7 @@ bidirectionalExperiment
nextRequests0
noTimeLimitsHandshake
maxAcceptedConnectionsLimit
(\connectionManager0 _serverAddr0 serverAsync0 -> do
link serverAsync0
(\connectionManager0 _serverAddr0 _serverAsync0 -> do
withBidirectionalConnectionManager "node-1" timeouts
nullTracer nullTracer nullTracer
nullTracer stdGen'' snocket makeBearer confSock
Expand Down

0 comments on commit 18e92c9

Please sign in to comment.