Skip to content

Commit a286307

Browse files
committed
make iface-error-test-1 more reliable
Progress and diagnostics can arrive in any order: a test that waits for both is creating a race condition
1 parent fa393f4 commit a286307

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

ghcide/test/exe/Main.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,8 +2690,6 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
26902690
expectDiagnostics
26912691
[("P.hs", [(DsWarning,(4,0), "Top-level binding")])] -- So what we know P has been loaded
26922692

2693-
waitForProgressDone
2694-
26952693
-- Change y from Int to B
26962694
changeDoc bdoc [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["module B where", "y :: Bool", "y = undefined"]]
26972695
-- save so that we can that the error propagates to A
@@ -2702,7 +2700,6 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
27022700
expectDiagnostics
27032701
[("A.hs", [(DsError, (5, 4), "Couldn't match expected type 'Int' with actual type 'Bool'")])]
27042702

2705-
27062703
-- Check that we wrote the interfaces for B when we saved
27072704
hidir <- getInterfaceFilesDir bdoc
27082705
hi_exists <- liftIO $ doesFileExist $ hidir </> "B.hi"
@@ -2712,7 +2709,6 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
27122709
expectDiagnostics
27132710
[("P.hs", [(DsWarning,(4,0), "Top-level binding")])
27142711
]
2715-
waitForProgressDone
27162712
changeDoc pdoc [TextDocumentContentChangeEvent Nothing Nothing $ pSource <> "\nfoo = y :: Bool" ]
27172713
-- Now in P we have
27182714
-- bar = x :: Int

0 commit comments

Comments
 (0)