Skip to content

Commit

Permalink
updated coverage calculation to use all available threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTimperley committed Jul 9, 2018
1 parent bb40d7f commit 057afb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/orchestrator/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@

def compute_mutant_coverage(client_bugzoo: BugZooClient,
client_boggart: BoggartClient,
mutant: Mutant
mutant: Mutant,
*,
threads: int = 6
) -> TestSuiteCoverage:
logger.info("computing coverage for mutant: %s", mutant)
coverage_baseline = load_baseline_coverage()
Expand All @@ -61,7 +63,8 @@ def compute_mutant_coverage(client_bugzoo: BugZooClient,
mutant_instrumented)
coverage = compute_coverage(client_bugzoo,
snapshot_instrumented,
tests)
tests,
threads=threads)
except Exception:
logger.warning("failed to compute coverage for mutant: %s", mutant)
raise FailedToComputeCoverage
Expand Down Expand Up @@ -112,7 +115,7 @@ def compute_coverage(client_bugzoo: BugZooClient,
snapshot: Snapshot,
tests: List[TestCase],
*,
threads: int = 4
threads: int = 6
) -> TestSuiteCoverage:
t_start = timer()
logger.debug("computing coverage")
Expand Down
3 changes: 2 additions & 1 deletion src/orchestrator/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ def _build_problem(self, perturbation: Mutation) -> Problem:
self.__coverage_for_mutant = \
compute_mutant_coverage(self.__client_bugzoo,
self.__client_boggart,
perturbation)
perturbation,
threads=self.num_threads)
self.__localization = localize(perturbation,
self.__coverage_for_mutant)
self.__coverage_for_mutant = \
Expand Down

0 comments on commit 057afb7

Please sign in to comment.