@@ -31,6 +31,7 @@ module Test.Hls
31
31
runSessionWithServerAndCaps ,
32
32
runSessionWithServerInTmpDir ,
33
33
runSessionWithServerAndCapsInTmpDir ,
34
+ runSessionWithServerNoRootLock ,
34
35
runSessionWithServer' ,
35
36
runSessionWithServerInTmpDir' ,
36
37
-- continuation version that take a FileSystem
@@ -618,7 +619,10 @@ lockForTempDirs = unsafePerformIO newLock
618
619
619
620
-- | Host a server, and run a test session on it
620
621
-- 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 ::
622
626
(Pretty b ) =>
623
627
-- | whether we disable the kick action or not
624
628
Bool ->
@@ -632,7 +636,7 @@ runSessionWithServer' ::
632
636
FilePath ->
633
637
Session a ->
634
638
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
636
640
(inR, inW) <- createPipe
637
641
(outR, outW) <- createPipe
638
642
@@ -676,6 +680,25 @@ runSessionWithServer' disableKick pluginsDp conf sconf caps root s = withLock l
676
680
putStrLn $ " Finishing canceling (took " <> showDuration t <> " s)"
677
681
pure x
678
682
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
+
679
702
-- | Wait for the next progress begin step
680
703
waitForProgressBegin :: Session ()
681
704
waitForProgressBegin = skipManyTill anyMessage $ satisfyMaybe $ \ case
0 commit comments