Commit Graph

21 Commits

Author SHA1 Message Date
Jun Wu
090d0eb5b7 tests: update tests output
Upstream 4a405ffd8b20 ("transaction-summary: show the range of new revisions
upon pull/unbundle (BC)", 2017-10-12) has changed the output.
2017-10-17 13:05:18 -07:00
Jun Wu
87e672961e sparse: rename to fbsparse
This avoids conflict with the core extension (`hgext/sparse.py`). In
development mode, the `hgext` version takes precedence and people can easily
use the wrong sparse extension.

`sparse.py` is kept for compatibility.

Differential Revision: https://phab.mercurial-scm.org/D1048
2017-10-13 14:51:27 -07:00
Jun Wu
3d461ae600 check-ext: make checks stricter
Summary:
Enhance check-ext script to be more strict:

 - Only one foreign extension is allowed: `remotenames`
 - Require explicit path for in-repo extensions to avoid wrong extensions
   being tested

This would make the test more predicatable since system extensions
will be less likely to be imported. Explicit path is better than
setting `PYTHONPATH` since `hgext/name.py` could override
`hgext3rd/name.py` regardless of `PYTHONPATH`.

Test Plan: arc unit

Reviewers: phillco, durham, ikostia, #mercurial, stash

Reviewed By: stash

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5271430

Signature: t1:5271430:1497861776:7dd35ec7c522cd9b26aa0871cb4306b4f1b8993a
2017-06-19 08:02:38 -07:00
Jun Wu
4a936cee21 codemod: remove extpath in tests
Summary:
Previously, the following pattern is common in our tests:

```
   $ extpath=`dirname $TESTDIR`
   $ cp $extpath/hgext3rd/name.py $TESTTMP # use $TESTTMP substitution in message
   $ cat >> $HGRCPATH<<EOF
   > [extensions]
   > name=$TESTTMP/name.py
   > EOF
```

Now, it gets simplified to:

```
   $ cat >> $HGRCPATH<<EOF
   > [extensions]
   > name=$TESTDIR/../hgext3rd/name.py
   > EOF
```

This removes unnecessary `dirname` and `cp`.

Also fixed a regex that does not match `bytes`:

```
-  transferred 268 bytes in [\d.]+ seconds \([\d.]+ KB/sec\) (re)
+  transferred 268 bytes in 0.3 seconds (939 bytes/sec)
```

Test Plan: arc unit

Reviewers: #mercurial, phillco

Reviewed By: phillco

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5270897

Signature: t1:5270897:1497663052:bf860a0b480c751b1e4b53cebf6526193f0f6652
2017-06-16 18:31:25 -07:00
Durham Goode
da7796c0fe fixtests: fix tests to work with upstream changes
Upstream has made some minor changes that affect the tests. Let's just update
the tests appropriately.
2017-05-16 09:40:27 -07:00
Durham Goode
f108f54ab0 fixtests: fix morestatus and perftweaks tests to match upstream
Upstream changed the transaction logic around rebase, and added better quoting
to tests, so we need to update our internal tests accordingly.
2017-03-21 09:18:01 -07:00
Martijn Pieters
1752a2ba84 Send a single string (normal) to scuba
Summary: The data was being sent to scuba, but then ignored altogether. Turn this into a single string instead.

Test Plan: arc unit

Reviewers: #sourcecontrol, andrasbelo

Reviewed By: andrasbelo

Subscribers: mjpieters, andrasbelo

Differential Revision: https://phabricator.intern.facebook.com/D4598196

Signature: t1:4598196:1487784582:8952e0e386325d1635029aab2b9d97e9284376ea
2017-02-22 14:36:28 -08:00
Durham Goode
5da804759f perftweaks: increase noderev cache coverage
Summary:
Previously the noderev cache only covered the branchmap. These days remotenames
and phases are also doing a lot of node->rev look ups, so let's add them to the
noderev cache as well.

Test Plan:
Compared hg book before and after the change. Noticed a significant
perf increase.

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4487962

Signature: t1:4487962:1485871615:634d95f61e916d81440a0f440010912af5ae6a13
2017-01-31 06:11:25 -08:00
Martijn Pieters
1c54b7f189 perftweaks: start logging active sparse profiles
Summary: Log active profiles for any command that uses the repository.

Test Plan: arc unit

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: andrasbelo, mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4346795

Signature: t1:4346795:1482251224:a9b3568eeb7e57c61273ce0dc9f4d41abcd2888e
2016-12-20 16:34:33 +00:00
Martijn Pieters
f0c75a557a sampling: stop arcanist from interfering with sampling tests
Summary:
SCM_SAMPLING_FILEPATH is set by arcanist, and thus the tests fail when you run
arc unit.

Test Plan: Run arc unit

Reviewers: #sourcecontrol, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4342459

Signature: t1:4342459:1481929811:1ac8db74cfd86be7ad35466e6eaf2f7e35ad9140
2016-12-16 23:19:23 +00:00
Martijn Pieters
a678247319 perftweaks: start logging the dirstate size
Summary:
Logging dirstate sizes gives us a way to track sparse profile use; how big a
working copy do people actually have?

The logged info can be directed to Scuba via the sampling extension.

Test Plan: Run on a local test repo with the debugger attached. Goal

Reviewers: #sourcecontrol, quark

Reviewed By: quark

Subscribers: mitrandir, quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4340367

Signature: t1:4340367:1481920819:d7358e0bdc2cc1422b36266374344e7d2b644ae5
2016-12-16 22:46:36 +00:00
Simon Farnsworth
00a1b105d4 test-perftweaks.t: make OS X compatible
Summary: Make the test pass on OS X with conditionals on the "only works on case-insensitive FS" block and a wider regex for output

Test Plan: Run on devserver and laptop

Reviewers: #sourcecontrol, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4074471

Signature: t1:4074471:1477410666:f0fb89060fd7c78e246e0772c4509334090c2d83
2016-10-25 09:03:15 -07:00
Jun Wu
8a3a99ba21 hgext: move single file extensions to hgext3rd
Summary:
Be a better citizen under system python path.

Fix all tests issues and change setup.py to use glob pattern to include
all extensions.

Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, durham, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3534311

Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2
2016-07-08 13:15:42 +01:00
Jun Wu
c73f628483 test-perftweaks: fix file permission test case
Summary:
test-perftweaks fails on both legocastle and my laptop:

```
-  total 12
-  drwxrwsr-x. 2 * . (glob)
-  drwxrwsr-x. 3 * .. (glob)
-  -rw-rw-r--. 1 * branchheads-served (glob)
+  total 4
+  drwxrwsr-x 2 quark quark  60 Apr  7 23:15 .
+  drwxrwsr-x 3 quark quark 120 Apr  7 23:15 ..
+  -rw-rw-r-- 1 quark quark   1 Apr  7 23:15 branchheads-served
```

Fix it by making `.` optional. It seems we only care about the `s` bit.

Test Plan: Run `test-perftweaks.t`

Reviewers: #sourcecontrol, rmcelroy, ttung

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.fb.com/D3153798

Tasks: 10749152

Signature: t1:3153798:1460073004:505d3dfee3dfd9475ccf700a1a28cf1baf1d8777
2016-04-07 16:53:18 -07:00
Ryan McElroy
5525a51fb6 perftweaks: use proper repo.vfs for noderevs cache
Summary:
Previously, we were calling open directly. Let's go via the vfs to
avoid nasty surprises in the future.

Test Plan:
Exisitng tests.
Also added a test, but that just verifies that the repo.vfs stuff doesn't
mess up the permissions when the umask is correct.

Reviewers: #sourcecontrol, ttung, durham

Reviewed By: durham

Subscribers: durham, mjpieters

Differential Revision: https://phabricator.fb.com/D3126492

Tasks: 10661429

Signature: t1:3126492:1459531801:0931f9b02c544f98651c7630e74283feef426175
2016-04-01 11:49:05 -07:00
Durham Goode
6579cd0c4e tests: fix blackbox output in perftweaks test
Upstream fixed a bug with blackbox so it always flushes it's output now. This
caused some slight test changes.
2016-02-17 15:31:37 -08:00
Laurent Charignon
0ca941a08a cleanup: use backtick instead of parent to capture output of shell cmd
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code.

Test Plan: all tests pass

Reviewers: #sourcecontrol, ttung, mitrandir, akushner

Reviewed By: akushner

Subscribers: mpm, akushner, mitrandir

Differential Revision: https://phabricator.fb.com/D2811997

Signature: t1:2811997:1452200059:9e4fca501a22f95d2d9a22d234758f55e292ea9a
2016-01-07 18:30:24 -08:00
Durham Goode
c0859c9e72 perftweaks: change revlog delta heuristic
Summary:
The existing upstream heurestic for determining when to accept a delta and when
not to takes into account the total ondisk distance from the chain base to the
current rev. In a large repo with 10+ active branches, its pretty easy to get
into a situation where a few full text entries are written, and suddenly new
entries are deciding they need to be full text too because they are too far from
their root, which in turn causes future entries to also choose full texts,
spiraling into huge revlogs.

The fix is to remove the condition around total ondisk distance. The new
heuristic only takes into account the delta chain size and distance, so it
should make the same choice each time, regardless of the amount of branching
happening or the full text choices of other branches.

Test Plan:
Did an hg pull in a repo that was known to be slow before. It was
veyr fast.

Reviewers: mpm, pyd, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2693043
2015-11-24 15:18:39 -08:00
Durham Goode
c5e9c5097f perftweaks: allow disabling the branch cache
Summary:
The branch cache is used to store a cache of each branches heads. If your
Mercurial repo doesn't have any branches though, this can be slow.

This tweak allows simplifying the branchcache computation to just say every head
in the repo belongs to the 'default' branch. This shaves 600ms off of some
commit commands.

I tested it by running the entire Mercurial test suite with it enabled, and
scanning the failures to make sure they were only related to repos that had
non-default branches.

Test Plan:
  $ cd ~/hg/tests
  $ ./run-tests.py -S -j 48 --extra-config-opt=perftweaks.disablebranchcache=True --extra-config-opt=extensions.perftweaks=/data/users/durham/fb-hgext/perftweaks.py

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy

Differential Revision: https://phabricator.fb.com/D2630360

Signature: t1:2630360:1447092762:adab0456ff842cf508b7f46e988ef9d865fa3988
2015-11-09 11:33:38 -08:00
Durham Goode
c093153d86 perftweaks: fix case collision check 2015-10-07 12:29:56 -07:00
Durham Goode
4d72067cbd Add option to disable reading from the tag cache
Summary:
The tag cache can be pretty expensive to populate, and in many of our repos we
do not even allow tags, so let's allo disable it entirely.

Test Plan: Added a test

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: #sourcecontrol, rmcelroy

Subscribers: rmcelroy

Differential Revision: https://phabricator.fb.com/D2481606
2015-09-25 13:45:08 -07:00