Do not remove workdir or move on to distill if early stop was requested. Note that early stop here does not include timeout. Early stop requests are caused by errors which need to be shown in the final results. If the workdir is removed and the execution attempt later got preempted, the next attempt will skip this test, as if it previously succeeded. By keeping the workdir, the next attempt would still try to run on the test and either hit the previous issue or avoid it and perform proper fuzzing. Either way is better than skipping the test. The only down side is that left workdir may increase the storage usage. But it will be removed in the next execution. PiperOrigin-RevId: 767710125
diff --git a/centipede/centipede_interface.cc b/centipede/centipede_interface.cc index ad2b459..504ccf2 100644 --- a/centipede/centipede_interface.cc +++ b/centipede/centipede_interface.cc
@@ -566,7 +566,7 @@ } absl::Cleanup clean_up_workdir = [is_workdir_specified, &env] { - if (!is_workdir_specified) { + if (!is_workdir_specified && !EarlyStopRequested()) { CHECK_OK(RemotePathDelete(env.workdir, /*recursively=*/true)); } }; @@ -638,6 +638,11 @@ .c_str())); } + if (EarlyStopRequested()) { + LOG(INFO) << "Skip updating corpus database due to early stop requested."; + continue; + } + // TODO(xinhaoyuan): Have a separate flag to skip corpus updating instead // of checking whether workdir is specified or not. if (fuzztest_config.only_replay || is_workdir_specified) continue;