Skip to content

Commit e76987a

Browse files
committed
Disable timeout in tactics testsuite
1 parent 44bddfa commit e76987a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugins/hls-tactics-plugin/src/Wingman/AbstractLSP/TacticActions.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import Wingman.LanguageServer.TacticProviders
2525
import Wingman.Machinery (runTactic, scoreSolution)
2626
import Wingman.Range
2727
import Wingman.Types
28+
import Development.IDE.Core.Service (getIdeOptionsIO)
29+
import Development.IDE.Types.Options (IdeTesting(IdeTesting), IdeOptions (IdeOptions, optTesting))
2830

2931

3032
------------------------------------------------------------------------------
@@ -34,7 +36,7 @@ makeTacticInteraction
3436
-> Interaction
3537
makeTacticInteraction cmd =
3638
Interaction $ Continuation @_ @HoleTarget cmd
37-
(SynthesizeCodeAction $ \env@LspEnv{..} hj -> do
39+
(SynthesizeCodeAction $ \env hj -> do
3840
pure $ commandProvider cmd $
3941
TacticProviderData
4042
{ tpd_lspEnv = env
@@ -48,9 +50,13 @@ makeTacticInteraction cmd =
4850
let span = fmap (rangeToRealSrcSpan (fromNormalizedFilePath fc_nfp)) hj_range
4951
TrackedStale _ pmmap <- mapMaybeT liftIO $ stale GetAnnotatedParsedSource
5052
pm_span <- liftMaybe $ mapAgeFrom pmmap span
53+
IdeOptions{optTesting = IdeTesting isTesting} <-
54+
liftIO $ getIdeOptionsIO (shakeExtras le_ideState)
55+
5156
let t = commandTactic cmd var_name
57+
timeout = if isTesting then maxBound else cfg_timeout_seconds le_config * seconds
5258

53-
liftIO $ runTactic (cfg_timeout_seconds le_config * seconds) hj_ctx hj_jdg t >>= \case
59+
liftIO $ runTactic timeout hj_ctx hj_jdg t >>= \case
5460
Left err ->
5561
pure
5662
$ pure

0 commit comments

Comments
 (0)