@@ -12,11 +12,14 @@ beforeEach(() => {
1212 vi . resetModules ( ) ;
1313 os . setPriority . mockReset ( ) ;
1414 process . argv [ 2 ] = "lint" ;
15- process . env . HYPERFRAMES_RENDER_SETUP_INPUT = JSON . stringify ( { projectDir : "/project" } ) ;
15+ process . env . HYPERFRAMES_RENDER_SETUP_INPUT = JSON . stringify ( {
16+ projectDir : "/project" ,
17+ background : true ,
18+ } ) ;
1619} ) ;
1720afterEach ( ( ) => vi . restoreAllMocks ( ) ) ;
1821
19- it ( "lints at the lowest CPU priority so it never competes with a Studio boot" , async ( ) => {
22+ it ( "a background lint runs at the lowest CPU priority so it never competes with a Studio boot" , async ( ) => {
2023 const write = vi . spyOn ( process . stdout , "write" ) . mockImplementation ( ( ) => true ) ;
2124
2225 await import ( "./renderSetupWorker.js" ) ;
@@ -25,6 +28,17 @@ it("lints at the lowest CPU priority so it never competes with a Studio boot", a
2528 expect ( write ) . toHaveBeenCalledWith ( expect . stringContaining ( '{"ok":true}' ) ) ;
2629} ) ;
2730
31+ // fails without the fix: a render waits on its lint, and at idle priority a busy Windows PC starved it for minutes.
32+ it ( "a render's lint keeps normal priority" , async ( ) => {
33+ process . env . HYPERFRAMES_RENDER_SETUP_INPUT = JSON . stringify ( { projectDir : "/project" } ) ;
34+ const write = vi . spyOn ( process . stdout , "write" ) . mockImplementation ( ( ) => true ) ;
35+
36+ await import ( "./renderSetupWorker.js" ) ;
37+
38+ expect ( os . setPriority ) . not . toHaveBeenCalled ( ) ;
39+ expect ( write ) . toHaveBeenCalledWith ( expect . stringContaining ( '{"ok":true}' ) ) ;
40+ } ) ;
41+
2842const nodeSystemErrorWithOsCodeInInfo = ( code : string ) =>
2943 Object . assign ( new Error ( `A system error occurred: uv_os_setpriority returned ${ code } ` ) , {
3044 code : "ERR_SYSTEM_ERROR" ,
0 commit comments