Skip to content

Commit b1b11e6

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 93ea4a0 commit b1b11e6

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

ghcide/test/exe/Main.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,19 +2662,15 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
26622662
expectDiagnostics
26632663
[("P.hs", [(DsWarning,(4,0), "Top-level binding")])] -- So what we know P has been loaded
26642664

2665-
waitForProgressDone
2666-
26672665
-- Change y from Int to B
26682666
changeDoc bdoc [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["module B where", "y :: Bool", "y = undefined"]]
26692667
-- save so that we can that the error propogates to A
26702668
sendNotification STextDocumentDidSave (DidSaveTextDocumentParams bdoc Nothing)
26712669

2672-
26732670
-- Check that the error propogates to A
26742671
expectDiagnostics
26752672
[("A.hs", [(DsError, (5, 4), "Couldn't match expected type 'Int' with actual type 'Bool'")])]
26762673

2677-
26782674
-- Check that we wrote the interfaces for B when we saved
26792675
hidir <- getInterfaceFilesDir bdoc
26802676
hi_exists <- liftIO $ doesFileExist $ hidir </> "B.hi"
@@ -2684,7 +2680,6 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
26842680
expectDiagnostics
26852681
[("P.hs", [(DsWarning,(4,0), "Top-level binding")])
26862682
]
2687-
waitForProgressDone
26882683
changeDoc pdoc [TextDocumentContentChangeEvent Nothing Nothing $ pSource <> "\nfoo = y :: Bool" ]
26892684
-- Now in P we have
26902685
-- bar = x :: Int

0 commit comments

Comments
 (0)