@@ -31,6 +31,7 @@ module Test.Hls
3131 runSessionWithServerAndCaps ,
3232 runSessionWithServerInTmpDir ,
3333 runSessionWithServerAndCapsInTmpDir ,
34+ runSessionWithServerNoRootLock ,
3435 runSessionWithServer' ,
3536 runSessionWithServerInTmpDir' ,
3637 -- continuation version that take a FileSystem
@@ -618,7 +619,10 @@ lockForTempDirs = unsafePerformIO newLock
618619
619620-- | Host a server, and run a test session on it
620621-- Note: cwd will be shifted into @root@ in @Session a@
621- runSessionWithServer' ::
622+ -- notice this function should only be used in tests that
623+ -- require to be nested in the same temporary directory
624+ -- use 'runSessionWithServerInTmpDir' for other cases
625+ runSessionWithServerNoRootLock ::
622626 (Pretty b ) =>
623627 -- | whether we disable the kick action or not
624628 Bool ->
@@ -632,7 +636,7 @@ runSessionWithServer' ::
632636 FilePath ->
633637 Session a ->
634638 IO a
635- runSessionWithServer' disableKick pluginsDp conf sconf caps root s = withLock lock $ keepCurrentDirectory $ do
639+ runSessionWithServerNoRootLock disableKick pluginsDp conf sconf caps root s = do
636640 (inR, inW) <- createPipe
637641 (outR, outW) <- createPipe
638642
@@ -676,6 +680,25 @@ runSessionWithServer' disableKick pluginsDp conf sconf caps root s = withLock l
676680 putStrLn $ " Finishing canceling (took " <> showDuration t <> " s)"
677681 pure x
678682
683+ -- | Host a server, and run a test session on it
684+ -- Note: cwd will be shifted into @root@ in @Session a@
685+ runSessionWithServer' ::
686+ (Pretty b ) =>
687+ -- | whether we disable the kick action or not
688+ Bool ->
689+ -- | Plugin to load on the server.
690+ PluginTestDescriptor b ->
691+ -- | lsp config for the server
692+ Config ->
693+ -- | config for the test session
694+ SessionConfig ->
695+ ClientCapabilities ->
696+ FilePath ->
697+ Session a ->
698+ IO a
699+ runSessionWithServer' disableKick pluginsDp conf sconf caps root s =
700+ withLock lock $ keepCurrentDirectory $ runSessionWithServerNoRootLock disableKick pluginsDp conf sconf caps root s
701+
679702-- | Wait for the next progress begin step
680703waitForProgressBegin :: Session ()
681704waitForProgressBegin = skipManyTill anyMessage $ satisfyMaybe $ \ case
0 commit comments