@@ -59,7 +59,18 @@ define(function (require, exports, module) {
5959 await awaitsFor ( function ( ) {
6060 return testWindow . _TypeScriptSupportReadyToIntegTest ;
6161 } , "TypeScript LSP server to start" , 30000 ) ;
62- } , 30000 ) ;
62+
63+ // Warm up tsserver. Its very first request pays a large one-time cost - spawning node,
64+ // launching vtsls, and loading the TypeScript library + project - which on a slow/loaded
65+ // CI runner can exceed a single spec's timeout (fast dev machines never see it). Pay it
66+ // once here with a generous budget so every spec below talks to an already-primed server;
67+ // later project-switch restarts reuse the warm process and are fast.
68+ await SpecRunnerUtils . loadProjectInTestWindow ( testFolder + "ts/" ) ;
69+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "type-error.ts" ] ) , "warm-up: open type-error.ts" ) ;
70+ await awaitsFor ( function ( ) {
71+ return $ ( "#problems-panel" ) . text ( ) . includes ( "not assignable" ) ;
72+ } , "tsserver to warm up on first cold start" , 90000 ) ;
73+ } , 100000 ) ;
6374
6475 afterAll ( async function ( ) {
6576 testWindow = null ;
@@ -85,34 +96,34 @@ define(function (require, exports, module) {
8596 // type-error.ts assigns a string to a `number` -> TS2322 "... not assignable ...".
8697 await awaitsFor ( function ( ) {
8798 return panelText ( ) . includes ( "not assignable" ) ;
88- } , "TypeScript type error to be reported" , 20000 ) ;
89- } , 30000 ) ;
99+ } , "TypeScript type error to be reported" , 30000 ) ;
100+ } , 45000 ) ;
90101
91102 it ( "should report implicit-any in a JS project that opts into checkJs" , async function ( ) {
92103 // js-checkjs has a jsconfig.json with checkJs + noImplicitAny, so the untyped parameter
93104 // in implicit.js IS flagged - and our diagnostic filter keeps it (the project opted in).
94105 await _openInProject ( "js-checkjs/" , "implicit.js" ) ;
95106 await awaitsFor ( function ( ) {
96107 return panelText ( ) . includes ( IMPLICIT_ANY_MESSAGE ) ;
97- } , "implicit-any to be reported under checkJs" , 20000 ) ;
98- } , 30000 ) ;
108+ } , "implicit-any to be reported under checkJs" , 30000 ) ;
109+ } , 45000 ) ;
99110
100111 it ( "should NOT report implicit-any in a plain JS project" , async function ( ) {
101112 // Precondition: confirm the server actually produces implicit-any for this exact code
102113 // (under checkJs), so the plain-project assertion below reflects gating, not just timing.
103114 await _openInProject ( "js-checkjs/" , "implicit.js" ) ;
104115 await awaitsFor ( function ( ) {
105116 return panelText ( ) . includes ( IMPLICIT_ANY_MESSAGE ) ;
106- } , "implicit-any under checkJs (precondition)" , 20000 ) ;
117+ } , "implicit-any under checkJs (precondition)" , 30000 ) ;
107118
108119 // Same code in a plain JS project (no jsconfig / no @ts-check): the "go add types" nag
109120 // must not appear. Wait for inspection to settle clean, then assert it is absent.
110121 await _openInProject ( "js-plain/" , "implicit.js" ) ;
111122 await awaitsFor ( function ( ) {
112123 return $ ( "#status-inspection" ) . hasClass ( "inspection-valid" ) ;
113- } , "plain JS inspection to settle with no problems" , 20000 ) ;
124+ } , "plain JS inspection to settle with no problems" , 30000 ) ;
114125 expect ( panelText ( ) . includes ( IMPLICIT_ANY_MESSAGE ) ) . toBe ( false ) ;
115- } , 30000 ) ;
126+ } , 75000 ) ;
116127
117128 // ----- hover quick-actions (Go to Definition / Find Usages) -------------------------------
118129
@@ -138,7 +149,7 @@ define(function (require, exports, module) {
138149 await awaitsFor ( async function ( ) {
139150 popover = await _hoverPopoverAt ( editor , CALL_LINE , CALL_CH ) ;
140151 return ! ! ( popover && popover . content && popover . content . find ( ".lsp-hover-action" ) . length === 2 ) ;
141- } , "hover quick actions to appear" , 20000 ) ;
152+ } , "hover quick actions to appear" , 30000 ) ;
142153
143154 const labels = popover . content . find ( ".lsp-hover-action-label" ) . map ( function ( ) {
144155 return $ ( this ) . text ( ) ;
@@ -158,16 +169,16 @@ define(function (require, exports, module) {
158169 $act . trigger ( "click" ) ;
159170 }
160171 return EditorManager . getCurrentFullEditor ( ) . getCursorPos ( ) . line === DECL_LINE ;
161- } , "Go to Definition to navigate to the declaration" , 25000 ) ;
172+ } , "Go to Definition to navigate to the declaration" , 30000 ) ;
162173 expect ( EditorManager . getCurrentFullEditor ( ) . getCursorPos ( ) . line ) . toBe ( DECL_LINE ) ;
163- } , 40000 ) ;
174+ } , 75000 ) ;
164175
165176 it ( "hover Find Usages opens the references panel (" + tc . ext + ")" , async function ( ) {
166177 await _openInProject ( tc . folder , tc . file ) ;
167178 const editor = EditorManager . getCurrentFullEditor ( ) ;
168179 await awaitsFor ( async function ( ) {
169180 return ! ! ( await _hoverPopoverAt ( editor , CALL_LINE , CALL_CH ) ) ;
170- } , "hover popover to be available" , 20000 ) ;
181+ } , "hover popover to be available" , 30000 ) ;
171182
172183 // "Find Usages" is the right-aligned action; clicking it opens the references panel.
173184 // Retry through the hover until the panel opens (the server may still be indexing).
@@ -181,9 +192,9 @@ define(function (require, exports, module) {
181192 $end . trigger ( "click" ) ;
182193 }
183194 return $ ( "#reference-in-files-results" ) . is ( ":visible" ) ;
184- } , "references panel to open" , 25000 ) ;
195+ } , "references panel to open" , 30000 ) ;
185196 expect ( $ ( "#reference-in-files-results" ) . is ( ":visible" ) ) . toBe ( true ) ;
186- } , 40000 ) ;
197+ } , 75000 ) ;
187198 } ) ;
188199 } ) ;
189200} ) ;
0 commit comments