@@ -116,18 +116,27 @@ func (env *testEnv) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]inst
116116 }
117117 return ret , nil
118118 }
119- ret = make ([]instance.EnvTestResult , numVMs - 1 )
119+ ret = make ([]instance.EnvTestResult , numVMs )
120120 if env .test .injectSyzFailure {
121- ret = append ( ret , instance.EnvTestResult {
122- Error : & instance.TestError {
121+ ret [ 0 ] = instance.EnvTestResult {
122+ Error : & instance.CrashError {
123123 Report : & report.Report {
124124 Title : "SYZFATAL: test" ,
125125 Type : crash .SyzFailure ,
126126 },
127127 },
128- })
129- } else {
130- ret = append (ret , instance.EnvTestResult {})
128+ }
129+ } else if env .test .injectLostConnection {
130+ for i := 0 ; i < numVMs / 3 ; i ++ {
131+ ret [i ] = instance.EnvTestResult {
132+ Error : & instance.CrashError {
133+ Report : & report.Report {
134+ Title : "lost connection to test machine" ,
135+ Type : crash .LostConnection ,
136+ },
137+ },
138+ }
139+ }
131140 }
132141 return ret , nil
133142}
@@ -312,11 +321,12 @@ type BisectionTest struct {
312321 expectErr bool
313322 expectErrType any
314323 // Expect res.Report != nil.
315- expectRep bool
316- noopChange bool
317- isRelease bool
318- flaky bool
319- injectSyzFailure bool
324+ expectRep bool
325+ noopChange bool
326+ isRelease bool
327+ flaky bool
328+ injectSyzFailure bool
329+ injectLostConnection bool
320330 // Expected number of returned commits for inconclusive bisection.
321331 commitLen int
322332 // For cause bisection: Oldest commit returned by bisection.
@@ -496,6 +506,16 @@ var bisectionTests = []BisectionTest{
496506 fixCommit : "500" ,
497507 isRelease : true ,
498508 },
509+ // Tests that bisection returns the correct fix commit despite `lost connection to test machine`.
510+ {
511+ name : "fix-finds-fix-despite-lost-connection" ,
512+ fix : true ,
513+ startCommit : 400 ,
514+ injectLostConnection : true ,
515+ commitLen : 1 ,
516+ fixCommit : "500" ,
517+ isRelease : true ,
518+ },
499519 // Tests that bisection returns the correct fix commit in case of SYZFATAL.
500520 {
501521 name : "fix-finds-fix-for-syzfatal" ,
0 commit comments