diff --git a/integration/test/Testlib/ModService.hs b/integration/test/Testlib/ModService.hs index 83b5cfcf900..e8ca2630af0 100644 --- a/integration/test/Testlib/ModService.hs +++ b/integration/test/Testlib/ModService.hs @@ -19,6 +19,7 @@ import Control.Monad.Reader import Control.Retry (fibonacciBackoff, limitRetriesByCumulativeDelay, retrying) import Data.Aeson hiding ((.=)) import qualified Data.Attoparsec.Text as Parser +import Data.Char (isSpace) import Data.Default import Data.Foldable import Data.Function @@ -312,7 +313,7 @@ parseSS :: Text -> Either String (Maybe (String, ProcessID)) parseSS input = if Text.null input then pure Nothing - else Just <$> Parser.parseOnly (ssParser <* Parser.endOfInput) input + else Just <$> Parser.parseOnly ssParser input -- Example input: -- LISTEN 0 4096 127.0.0.1:8082 0.0.0.0:* users:(("brig",pid=51468,fd=79)) @@ -328,11 +329,12 @@ ssParser = do _ <- Parser.char ',' p <- pid _ <- Parser.many1 noNewLine + Parser.endOfInput pure (name, p) where spaces = void $ Parser.many' Parser.space - noSpace = Parser.satisfy (/= ' ') - noSpaces = Parser.many1 noSpace + noSpaces = Parser.takeWhile1 (not . isSpace) + noDoubleQuote = Parser.takeWhile1 (/= '"') token p = do spaces res <- p @@ -344,7 +346,7 @@ ssParser = do quoted = do token $ do _ <- Parser.char '"' - tok <- noSpaces + tok <- Text.unpack <$> noDoubleQuote _ <- Parser.char '"' pure tok pid = do