@@ -42,6 +42,10 @@ describe('smoketest: devboxes', () => {
4242 test . concurrent (
4343 'create devbox with authenticated tunnel in create params (deprecated polling path)' ,
4444 async ( ) => {
45+ const warnSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ...args : unknown [ ] ) => {
46+ if ( typeof args [ 0 ] === 'string' && args [ 0 ] . includes ( '[runloop-api-client]' ) ) return ;
47+ process . stderr . write ( `console.warn: ${ args . join ( ' ' ) } \n` ) ;
48+ } ) ;
4549 let devbox : DevboxView | undefined ;
4650 try {
4751 devbox = await client . devboxes . createAndAwaitRunning (
@@ -63,6 +67,7 @@ describe('smoketest: devboxes', () => {
6367 expect ( devbox . tunnel ?. auth_mode ) . toBe ( 'authenticated' ) ;
6468 expect ( devbox . tunnel ?. auth_token ) . toBeTruthy ( ) ;
6569 } finally {
70+ warnSpy . mockRestore ( ) ;
6671 if ( devbox ) {
6772 await client . devboxes . shutdown ( devbox . id ) ;
6873 }
@@ -178,17 +183,25 @@ describe('smoketest: devboxes', () => {
178183 ) ;
179184
180185 test ( 'await running (createAndAwaitRunning, deprecated polling path)' , async ( ) => {
181- const created = await client . devboxes . createAndAwaitRunning (
182- {
183- name : uniqueName ( 'smoketest-devbox2' ) ,
184- launch_parameters : { resource_size_request : 'X_SMALL' , keep_alive_time_seconds : 60 * 5 } , // 5 minutes
185- } ,
186- {
187- polling : { timeoutMs : 20 * 60 * 1000 } ,
188- } ,
189- ) ;
190- expect ( created . status ) . toBe ( 'running' ) ;
191- devboxId = created . id ;
186+ const warnSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ...args : unknown [ ] ) => {
187+ if ( typeof args [ 0 ] === 'string' && args [ 0 ] . includes ( '[runloop-api-client]' ) ) return ;
188+ process . stderr . write ( `console.warn: ${ args . join ( ' ' ) } \n` ) ;
189+ } ) ;
190+ try {
191+ const created = await client . devboxes . createAndAwaitRunning (
192+ {
193+ name : uniqueName ( 'smoketest-devbox2' ) ,
194+ launch_parameters : { resource_size_request : 'X_SMALL' , keep_alive_time_seconds : 60 * 5 } , // 5 minutes
195+ } ,
196+ {
197+ polling : { timeoutMs : 20 * 60 * 1000 } ,
198+ } ,
199+ ) ;
200+ expect ( created . status ) . toBe ( 'running' ) ;
201+ devboxId = created . id ;
202+ } finally {
203+ warnSpy . mockRestore ( ) ;
204+ }
192205 } ) ;
193206
194207 test ( 'list devboxes' , async ( ) => {
@@ -232,17 +245,25 @@ describe('smoketest: devboxes', () => {
232245 test . concurrent (
233246 'createAndAwaitRunning timeout (deprecated polling path)' ,
234247 async ( ) => {
235- await expect (
236- client . devboxes . createAndAwaitRunning (
237- {
238- name : uniqueName ( 'smoketest-devbox-await-running-timeout' ) ,
239- launch_parameters : { launch_commands : [ 'sleep 70' ] , keep_alive_time_seconds : 30 } ,
240- } ,
241- {
242- polling : { timeoutMs : 100 } ,
243- } ,
244- ) ,
245- ) . rejects . toThrow ( ) ;
248+ const warnSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ...args : unknown [ ] ) => {
249+ if ( typeof args [ 0 ] === 'string' && args [ 0 ] . includes ( '[runloop-api-client]' ) ) return ;
250+ process . stderr . write ( `console.warn: ${ args . join ( ' ' ) } \n` ) ;
251+ } ) ;
252+ try {
253+ await expect (
254+ client . devboxes . createAndAwaitRunning (
255+ {
256+ name : uniqueName ( 'smoketest-devbox-await-running-timeout' ) ,
257+ launch_parameters : { launch_commands : [ 'sleep 70' ] , keep_alive_time_seconds : 30 } ,
258+ } ,
259+ {
260+ polling : { timeoutMs : 100 } ,
261+ } ,
262+ ) ,
263+ ) . rejects . toThrow ( ) ;
264+ } finally {
265+ warnSpy . mockRestore ( ) ;
266+ }
246267 } ,
247268 SHORT_TIMEOUT * 4 ,
248269 ) ;
0 commit comments