From 87159fd5ddf41c5b0b090408b3e71e6b1cfb1a59 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Sun, 27 Oct 2024 15:10:47 -0700 Subject: [PATCH] Fix a flaky windows test --- test/FSNotify/Test/EventTests.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/FSNotify/Test/EventTests.hs b/test/FSNotify/Test/EventTests.hs index 85d3ef1..4782791 100644 --- a/test/FSNotify/Test/EventTests.hs +++ b/test/FSNotify/Test/EventTests.hs @@ -58,7 +58,9 @@ eventTests' timeInterval threadingMode poll recursive nested = do pauseAndRetryOnExpectationFailure timeInterval 3 $ liftIO getEvents >>= \events -> if | nested && not recursive -> events `shouldBe` [] | isWin && not poll -> case events of + -- On Windows, we sometimes get an extra modified event [Modified {}, Added {..}] | eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return () + [Added {..}, Modified {}] | eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return () _ -> expectationFailure $ "Got wrong events: " <> show events | otherwise -> case events of [Added {..}] | eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return ()