Skip to content

Commit 3f50c36

Browse files
committed
Fix flaky test
1 parent 41f917e commit 3f50c36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ghcide/test/exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,16 @@ diagnosticTests = testGroup "diagnostics"
421421
let contentA = T.unlines [ "module ModuleA where" ]
422422
_ <- createDoc "ModuleA.hs" "haskell" contentA
423423
expectDiagnostics [("ModuleB.hs", [])]
424-
, ignoreTestBecause "Flaky #2831" $ testSessionWait "add missing module (non workspace)" $ do
424+
, testSession' "add missing module (non workspace)" $ \tmpDir -> do
425425
-- need to canonicalize in Mac Os
426-
tmpDir <- liftIO $ canonicalizePath =<< getTemporaryDirectory
427426
let contentB = T.unlines
428427
[ "module ModuleB where"
429428
, "import ModuleA ()"
430429
]
431430
_ <- createDoc (tmpDir </> "ModuleB.hs") "haskell" contentB
432431
expectDiagnostics [(tmpDir </> "ModuleB.hs", [(DsError, (1, 7), "Could not find module")])]
433432
let contentA = T.unlines [ "module ModuleA where" ]
433+
liftIO $ writeFile (tmpDir </> "ModuleA.hs") $ T.unpack contentA
434434
_ <- createDoc (tmpDir </> "ModuleA.hs") "haskell" contentA
435435
expectDiagnostics [(tmpDir </> "ModuleB.hs", [])]
436436
, testSessionWait "cyclic module dependency" $ do

0 commit comments

Comments
 (0)