@@ -517,6 +517,7 @@ async function collectGridSamples(
517517 helpers : Promise < CheckAuditDriver [ ] > ,
518518 enter : ( phase : CheckPhase ) => void ,
519519 report : CheckProgress ,
520+ keep : ( read : ( ) => Partial < CheckBrowserResult > ) => void ,
520521) : Promise < GridSamples > {
521522 const geometryEnabled = grid . captionSamples . length > 0 || grid . frameSamples . length > 0 ;
522523 const sets : SampleSets = {
@@ -528,6 +529,17 @@ async function collectGridSamples(
528529 const times = mergeSampleTimes ( grid . layoutSamples , motion . times ) ;
529530 const pending = times . map ( ( _ , index ) => index ) ;
530531 const perTime : GridSamples [ ] = [ ] ;
532+ keep ( ( ) => {
533+ const so = emptyGridSamples ( ) ;
534+ for ( const samples of perTime ) if ( samples ) appendGridSamples ( so , samples ) ;
535+ const contrast = buildContrastResults ( so . contrastEntries ) ;
536+ return {
537+ layoutIssues : so . layoutIssues ,
538+ contrastFindings : contrast . findings ,
539+ contrastChecked : so . contrastEntries . length ,
540+ contrastPassed : contrast . passed ,
541+ } ;
542+ } ) ;
531543 let finished = 0 ;
532544 const work = async ( worker : CheckAuditDriver , taken : number [ ] = [ ] ) => {
533545 for ( let index = pending . shift ( ) ; index !== undefined ; index = pending . shift ( ) ) {
@@ -1466,6 +1478,7 @@ export async function runAuditGrid(
14661478 helpers : Promise < CheckAuditDriver [ ] > = Promise . resolve ( [ ] ) ,
14671479 enter : ( phase : CheckPhase ) => void = ( ) => { } ,
14681480 report : CheckProgress = ( ) => { } ,
1481+ keep : ( read : ( ) => Partial < CheckBrowserResult > ) => void = ( ) => { } ,
14691482) : Promise < CheckBrowserResult > {
14701483 enter ( "samples" ) ;
14711484 await driver . initialize ( options . contrast ) ;
@@ -1476,7 +1489,16 @@ export async function runAuditGrid(
14761489 grid . duration ,
14771490 ) ;
14781491 const seekLoopStart = Date . now ( ) ;
1479- const collected = await collectGridSamples ( driver , options , grid , plan , helpers , enter , report ) ;
1492+ const collected = await collectGridSamples (
1493+ driver ,
1494+ options ,
1495+ grid ,
1496+ plan ,
1497+ helpers ,
1498+ enter ,
1499+ report ,
1500+ keep ,
1501+ ) ;
14801502 const seekLoopMs = Date . now ( ) - seekLoopStart ;
14811503
14821504 let motionIssues = plan . preflightIssues ;
@@ -1642,8 +1664,9 @@ export async function runCheckPipeline(
16421664 dependencies . runBrowserCheck ( project , options , motion , deadline , browserAhead ) ,
16431665 ) ;
16441666 } catch ( error ) {
1645- browser = emptyBrowserResult ( ) ;
1646- browser . runtimeFindings . push ( runtimeFailure ( error ) ) ;
1667+ const found = deadline . partialResult ( ) ;
1668+ browser = { ...emptyBrowserResult ( ) , ...found , skipped : Object . keys ( found ) . length === 0 } ;
1669+ browser . runtimeFindings = [ ...browser . runtimeFindings , runtimeFailure ( error ) ] ;
16471670 }
16481671
16491672 const snapshotFiles = options . snapshots
0 commit comments