@@ -23,8 +23,6 @@ import System.FilePath
2323import System.Directory
2424#endif
2525
26−import Debug.Trace
27−
2826type Timeout = Int
2927
3028testList :: SessionId -> Connection -> MVar () -> Test
@@ -44,7 +42,7 @@ testList sessionId conn notificationTestMVar = TestList $ serverTests ++ session
4442 testRelationVariableSummary,
4543 testNotification notificationTestMVar
4644 ]
47− serverTests = [testRequestTimeout, testFileDescriptorCount]
45+ serverTests = [testRequestTimeout, testFileDescriptorCount, testClientConnectFail]
4846
4947main :: IO ()
5048main = do
@@ -209,7 +207,7 @@ testRequestTimeout = TestCase $ do
209207 case eTestConn of
210208 Left err -> putStrLn ("failed to connect: " ++ show err) >> exitFailure
211209 Right (session, testConn) -> do
212− res <- catchJust (\exc -> if traceShowId exc == RequestTimeoutException then Just exc else Nothing) (callTestTimeout_ session testConn) (const (pure False))
210+ res <- catchJust (\exc -> if exc == RequestTimeoutException then Just exc else Nothing) (callTestTimeout_ session testConn) (const (pure False))
213211 assertBool "timeout exception was not thrown" (not res)
214212 killThread serverTid
215213
@@ -240,3 +238,12 @@ fdCount = do
240238--pass on non-linux platforms
241239testFileDescriptorCount = TestCase (pure ())
242240#endif
241+
242+testClientConnectFail :: Test
243+testClientConnectFail = TestCase $ do
244+ let connInfo = RemoteConnectionInfo "non-existent-db" "127.0.0.1" "8888" emptyNotificationCallback
245+ eConn <- connectProjectM36 connInfo
246+ case eConn of
247+ Left err -> pure ()
248+ Right _ -> assertFailure "unexpected connection success"
249+