This is an archive of the discontinued Mercurial Phabricator instance.

tests: optimize test-copytrace-heuristics.t
ClosedPublic

Authored by pulkit on Oct 9 2017, 5:09 PM.

Details

Summary

test-copytrace-heuristics.t tests the heuristics algorithm of copytracing. The
test has a pattern of making a server repo first and then cloning into a local
repo for each test to have public and draft commits. This is done because if we
have all draft commits and we have very less commits, heuristics will fallback
to full copytracing as that will be fast.

To avoid creating the server repo, we set the commit limit to -1 so that
everytime we perform the heuristics algorithm even when having full drafts and
tweak the config setting when we need to test the ability to fallback to full
copytracing.

This optimizes this test by 3 seconds.

Before:

real 0m41.503s
user 0m36.068s
sys 0m3.900s

After:

real 0m38.826s
user 0m33.884s
sys 0m3.396s

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 9 2017, 5:09 PM
durin42 accepted this revision.Oct 10 2017, 11:08 AM
This revision is now accepted and ready to land.Oct 10 2017, 11:08 AM
This revision was automatically updated to reflect the committed changes.