diff --git a/common/experiment_utils.py b/common/experiment_utils.py index 3911751ac..15b38d33e 100644 --- a/common/experiment_utils.py +++ b/common/experiment_utils.py @@ -128,6 +128,10 @@ def get_corpus_archive_name(cycle: int) -> str: """Returns a corpus archive name given a cycle.""" return get_cycle_filename('corpus-archive', cycle) + '.tar.gz' +def get_coverage_archive_name(cycle: int) -> str: + """Returns a corpus archive name given a cycle.""" + return get_cycle_filename('coverage-archive', cycle) + '.json' + def get_stats_filename(cycle: int) -> str: """Returns a corpus archive name given a cycle.""" diff --git a/experiment/measurer/measure_manager.py b/experiment/measurer/measure_manager.py index 288148401..a23d1e55f 100644 --- a/experiment/measurer/measure_manager.py +++ b/experiment/measurer/measure_manager.py @@ -614,10 +614,18 @@ def measure_snapshot_coverage( # pylint: disable=too-many-locals # Generate profdata and transform it into json form. snapshot_measurer.generate_coverage_information(cycle) + # Save profdata snapshot. + coverage_archive_dst = experiment_utils.get_coverage_archive_name(cycle) + if filestore_utils.cp(snapshot_measurer.cov_summary_file, + coverage_archive_dst, + expect_zero=False).retcode: + snapshot_logger.warning('Coverage not found for cycle: %d.', cycle) + return None + # Run crashes again, parse stacktraces and generate crash signatures. crashes = snapshot_measurer.process_crashes(cycle) - # Get the coverage of the new corpus units. + # Get the coverage summary of the new corpus units. branches_covered = snapshot_measurer.get_current_coverage() fuzzer_stats_data = snapshot_measurer.get_fuzzer_stats(cycle) snapshot = models.Snapshot(time=this_time,