Skip to content
Snippets Groups Projects
Commit eecaf6f8 authored by Egor Ivkov's avatar Egor Ivkov Committed by Dmitry Ivanov
Browse files

test/fuzz: fuzz_until.py: record latest coverage increase instead of latest new path

NO_DOC=internal
NO_TEST=internal
NO_CHANGELOG=internal
parent 05755671
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ class Supervisor:
self.init_ft = None
self.latest_ft = None
self.latest_n_inputs = 0
self.latest_new_path = self.start_time
self.latest_cov_inc = self.start_time
def criteria_satisfied(self) -> bool:
"""Indicates whether stopping criteria of the corresponding fuzzer
......@@ -94,14 +94,16 @@ class Supervisor:
# At least 100_000 fuzzer test runs
n_inputs = self.latest_n_inputs > 100_000
# Last new path was discovered 2 hours ago
new_path = (time.monotonic() - self.latest_new_path) > 2 * 60 * 60
# Last coverage increase was detected 2 hours ago
cov_inc = (time.monotonic() - self.latest_cov_inc) > 2 * 60 * 60
return (cov or ft or not self.wait_2x_cov) and n_inputs and new_path
return (cov or ft or not self.wait_2x_cov) and n_inputs and cov_inc
def update_stats(self, msg: Msg):
self.latest_n_inputs = msg.n_inputs
if msg.cov:
if self.latest_cov and msg.cov > self.latest_cov:
self.latest_cov_inc = time.monotonic()
self.latest_cov = msg.cov
if msg.ft:
self.latest_ft = msg.ft
......@@ -110,9 +112,6 @@ class Supervisor:
self.init_cov = msg.cov
self.init_ft = msg.ft
if msg.ty == MsgType.NEW:
self.latest_new_path = time.monotonic()
def run(self):
"""Run the corresponding fuzzer until either stopping criteria are
satisfied or fuzzing fails with an error indicating that some problem
......@@ -123,9 +122,6 @@ class Supervisor:
[
f"./oss-fuzz/build/out/tarantool/{self.fuzzer_name}_fuzzer",
# reduction might slow down both fuzzer and superviser
"-reduce_inputs=0",
# Read from both corpus folders, write only to the first
self.corpus_dir.resolve(),
f"test/static/corpus/{self.fuzzer_name}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment