Skip to content

Commit

Permalink
Revert "fix fuzz for -j 0"
Browse files Browse the repository at this point in the history
This reverts commit 97ab1d7.
  • Loading branch information
mpsijm committed Feb 3, 2024
1 parent 1e31e39 commit 76ffe54
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions bin/fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,16 @@ def run(self):
self.tasks = 0
self.queue = parallel.Parallel(lambda task: task.run(bar), pin=True)

if self.queue.num_threads:
# pool of ids used for generators
self.tmp_ids = 2 * max(1, self.queue.num_threads) + 1
self.free_tmp_id = {*range(self.tmp_ids)}
self.tmp_id_count = [0] * self.tmp_ids
# pool of ids used for generators
self.tmp_ids = 2 * max(1, self.queue.num_threads) + 1
self.free_tmp_id = {*range(self.tmp_ids)}
self.tmp_id_count = [0] * self.tmp_ids

# add first generator task
self.finish_task()

# wait for the queue to run empty (after config.args.time)
self.queue.join()
else:
self.tmp_ids = -1
while time.monotonic() - self.start_time <= config.args.time:
testcase_rule = self.testcase_rules[self.iteration % len(self.testcase_rules)]
self.iteration += 1
self.queue.put(GeneratorTask(self, testcase_rule, self.iteration, None))
self.queue.join()
# add first generator task
self.finish_task()

# wait for the queue to run empty (after config.args.time)
self.queue.join()
# At this point, no new tasks may be started anymore.
self.queue.done()
bar.done()
Expand Down

0 comments on commit 76ffe54

Please sign in to comment.