Summary: The xrange function doesn't exist in python3, use the pycompat version instead.
Reviewed By: ikostia
Differential Revision: D17607522
fbshipit-source-id: c7b992071ad7933372033892ca99e240aa11ccba
Summary:
There are multiple places that want to know whether the code is running inside
tests or not. Add `util.istest` for that and migrate those callsites to use it.
Reviewed By: xavierd
Differential Revision: D16344715
fbshipit-source-id: faa4261c83e4d889d59d63968b440954c4cac2ce
Summary:
By default, simplecache puts its local cache in a global location that persists
across test runs. That can cause surprises. Change the location to be inside
$TESTTMP under tests.
Reviewed By: xavierd
Differential Revision: D16036296
fbshipit-source-id: c73b573b87d49798f4ad146a1c0a559f5d94caf1
Summary:
In S179901, we've seen a couple of instances of `hg status` consuming as much
memory as they could until getting OOM killed. Looking at backtraces for these
processes (P67246356) the code spins trying to read data from memcache. The
connection is however closed and therefore `recv` returns an empty string,
which is then added to a list and the `recv` is retried again.
Reviewed By: kulshrax
Differential Revision: D15947154
fbshipit-source-id: f1216e26b0ce159377ff8e82bedc13a7cc3d0444
Summary:
We're encountering an issue that I think is caused by invalid data
coming back from memcache, possibly due to our recently introduced connection
reusing. Let's add some checksums to verify that the data we put in is identical
to the data we get out for a given key.
Reviewed By: kulshrax
Differential Revision: D14141683
fbshipit-source-id: 206b51b862db7d54def02f5310b90f473d5a0d03
Summary: My earlier diff broke master, this is the fix.
Reviewed By: markbt
Differential Revision: D14005894
fbshipit-source-id: 6ce43913fb501791592512f2f12cd67ef27f0457
Summary:
reuse the connection for other requests
I made it global
Reviewed By: quark-zju
Differential Revision: D13964705
fbshipit-source-id: ed759e36f15b91a838dc2c20b58384ae54ad5d48
Summary:
The simplecache test attempts to connect to a memcache instance on localhost.
This means the test fails if a memcache instance is not available.
Remove the use of memcache in the test. We still test local files, and assume
that memcache itself works.
Also corrupt the correct key when testing corruption handling, and document the
config options.
Reviewed By: quark-zju
Differential Revision: D13818471
fbshipit-source-id: 6ca7f575aa813f95773144be5337796f029ffd90
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.
Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.
Reviewed By: phillco
Differential Revision: D13868981
fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.
To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.
Reviewed By: phillco, ikostia
Differential Revision: D13853115
fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e