@@ -8930,7 +8930,7 @@ it.layer(layerQueueResumeDisabledInstanceTest)(
89308930
89318931const watchCostScenarios = [
89328932 { name : "quiet PR" , saves : 48 } ,
8933- { name : "review comment edited" , reviewCommentEdit : 40 , saves : 48 } ,
8933+ { name : "review comment edited" , reviewCommentEdit : 40 , saves : 32 } ,
89348934 {
89358935 name : "review comment edit missing from the inbox" ,
89368936 reviewCommentEdit : 40 ,
@@ -8939,6 +8939,13 @@ const watchCostScenarios = [
89398939 saves : 48 ,
89408940 } ,
89418941 { name : "noisy inbox" , inboxEveryMinute : true , saves : 45 } ,
8942+ {
8943+ name : "checks swap while the pull request keeps moving" ,
8944+ pullRequestInboxEveryMinute : true ,
8945+ checksSwapAt : 10 ,
8946+ ceilingWake : 120 ,
8947+ saves : 0 ,
8948+ } ,
89428949 { name : "notifications readable again" , notificationsReadableFrom : 60 , saves : 32 } ,
89438950 { name : "unsubscribed author" , viewerSubscription : "UNSUBSCRIBED" , saves : 0 } ,
89448951] ;
@@ -9004,6 +9011,9 @@ it.layer(Layer.fresh(layerTest))("pull request watch request cost", (it) => {
90049011 if ( scenario . inboxEveryMinute ) {
90059012 for ( let minute = 0 ; at ( minute ) <= now ; minute += 1 ) bump ( 900 , at ( minute ) + 3_000 ) ;
90069013 }
9014+ if ( scenario . pullRequestInboxEveryMinute ) {
9015+ for ( let minute = 0 ; at ( minute ) <= now ; minute += 1 ) bump ( number , at ( minute ) + 3_000 ) ;
9016+ }
90079017 return times ;
90089018 } ;
90099019
@@ -9024,14 +9034,23 @@ it.layer(Layer.fresh(layerTest))("pull request watch request cost", (it) => {
90249034 } ;
90259035 } ) ,
90269036 detail : ( ) =>
9027- Effect . sync ( ( ) => {
9037+ Effect . map ( Clock . currentTimeMillis , ( now ) => {
90289038 cost . graphql += 1 ;
9039+ const check = ( name : string , failed : boolean ) => ( {
9040+ name,
9041+ status : failed ? ( "failure" as const ) : ( "success" as const ) ,
9042+ description : null ,
9043+ url : null ,
9044+ } ) ;
9045+ const swapped =
9046+ scenario . checksSwapAt !== undefined && now >= at ( scenario . checksSwapAt ) ;
90299047 return {
90309048 ...watchedPullRequestDetail ( { projectId, number, at : iso ( startedAt ) } ) ,
90319049 headSha : "abc1234def" ,
9032- checks : [
9033- { name : "ci" , status : "success" as const , description : null , url : null } ,
9034- ] ,
9050+ checks :
9051+ scenario . checksSwapAt === undefined
9052+ ? [ check ( "ci" , false ) ]
9053+ : [ check ( "lint" , ! swapped ) , check ( "test" , swapped ) ] ,
90359054 } ;
90369055 } ) ,
90379056 activity : ( ) =>
0 commit comments