@@ -82,6 +82,8 @@ export function createDevTests(config?: DevTestConfig) {
8282 : process . platform === 'win32'
8383 ? 140_000
8484 : 70_000 ;
85+ const multiPhaseHmrTestTimeoutMs =
86+ hmrTestTimeoutMs + hmrRediscoveryTimeoutMs ;
8587 const flowRouteHmrFuzzTimeoutMs = finalConfig . canary ? 480_000 : 240_000 ;
8688 const readManifestStepFunctionNames = async ( ) : Promise < string [ ] > => {
8789 const manifestJson = await fs . readFile ( workflowManifestPath , 'utf8' ) ;
@@ -458,7 +460,11 @@ export async function hmrPageWorkflow() {
458460
459461 test (
460462 'should rebuild on workflow change' ,
461- { timeout : hmrTestTimeoutMs } ,
463+ {
464+ timeout : usesNextFlowRoute
465+ ? multiPhaseHmrTestTimeoutMs
466+ : hmrTestTimeoutMs ,
467+ } ,
462468 async ( ) => {
463469 if ( usesNextFlowRoute ) {
464470 await waitForHmrReady ( ) ;
@@ -491,7 +497,7 @@ ${apiFileContent}`
491497 ) ;
492498 await pollUntil ( {
493499 description : 'workflow-change fixture to appear in manifest' ,
494- timeoutMs : 50_000 ,
500+ timeoutMs : hmrRediscoveryTimeoutMs ,
495501 check : async ( ) => {
496502 await prewarm ( ) ;
497503 expect ( await readManifestWorkflowFunctionNames ( ) ) . toContain (
@@ -517,7 +523,7 @@ export async function myNewWorkflow() {
517523
518524 await pollUntil ( {
519525 description : 'generated workflow to include myNewWorkflow' ,
520- timeoutMs : usesNextFlowRoute ? 50_000 : 25_000 ,
526+ timeoutMs : usesNextFlowRoute ? hmrRediscoveryTimeoutMs : 25_000 ,
521527 check : async ( ) => {
522528 if ( usesNextFlowRoute ) {
523529 await prewarm ( ) ;
@@ -717,7 +723,7 @@ ${apiFileContent}`
717723
718724 await pollUntil ( {
719725 description : 'generated workflow to include newWorkflowFile' ,
720- timeoutMs : 50_000 ,
726+ timeoutMs : hmrRediscoveryTimeoutMs ,
721727 check : async ( ) => {
722728 if ( usesNextFlowRoute ) {
723729 const manifestJson = await fs . readFile (
0 commit comments