This commit is contained in:
Alberto G. Corona 2017-08-15 18:38:05 +02:00
parent 1390724668
commit c1a70374d1
2 changed files with 3 additions and 3 deletions

View file

@ -55,7 +55,6 @@ requestInstance :: String -> Service -> Int -> Cloud [Node]
requestInstance ident service num= loggedc $ do
-- return () !> "requestInstance"
local $ onException $ \(e:: ConnectionError) -> startMonitor >> continue -- !> ("EXCEPTIOOOOOOOOOOON",e)
nodes <- callService' ident monitorNode (ident,service,num)
local $ addNodes nodes -- !> ("ADDNODES",service)
return nodes

View file

@ -32,12 +32,15 @@ service= [("service","test suite")
main= do
mr <- keep $ test `catcht` \(e:: SomeException) -> liftIO (putStr "EXCEPTiON: " >> print e) >> exit (Just e)
endMonitor
case mr of
Nothing -> print "NO RESULT, NO THREADS RUNNING" >> exitFailure
Just Nothing -> print "SUCCESS" >> exitSuccess
Just (Just e) -> putStr "FAIL: " >> print e >> exitFailure
test= initNodeServ service "localhost" 8080 $ do
@ -45,7 +48,6 @@ test= initNodeServ service "localhost" 8080 $ do
local $ guard (nodePort node0== 8080) -- only executes in node 8080
-- local $ option "get" "get instances"
localIO $ return () !> "REQUEST INSTANCE "
@ -90,7 +92,6 @@ test= initNodeServ service "localhost" 8080 $ do
localIO $ print r
assert (sort (M.toList r) == sort [("hello",2::Int),("world",1)]) $ return r
localIO endMonitor
local $ exit (Nothing :: Maybe SomeException) -- remove this to repeat the test