v8/test/test262
ssanfilippo 1c1b70c98d [Swarming] work around slow calls in archive.py
Apparently, the tarfile Python module spends a lot of time in
grp.getgrid for retrieving a piece information (the name of the
primary group) which we don't need anyway. There is no
proper way to disable these slow calls, but there's a workaround
which relies on the way in which grp (and pwd) is used.

In fact, pwd and grp are imported in this fashion:

    try:
        import grp, pwd
    except ImportError:
        grp = pwd = None

and then used with the following pattern [2]:

      if grp:
          try:
              tarinfo.gname = grp.getgrgid(tarinfo.gid)[0]
          except KeyError:
              pass

By setting grp and pwd to None, thus skipping the calls, I was
able to achieve a 35x speedup on my workstation.

The user and group names are set to test262 when building the tar.

The downside to this approach is that we are relying on an
implementation detail, which is not in the public API.
However, the blamelist shows that the relevant bits of the module
have not been updated since 2003 [3], so we might as well assume
that the workaround will keep working, on cPython 2.x at least.

---

[1] https://hg.python.org/cpython/file/2.7/Lib/tarfile.py#l56
[2] https://hg.python.org/cpython/file/2.7/Lib/tarfile.py#l1933
[3] https://hg.python.org/cpython/rev/f9a5ed092660

BUG=chromium:535160
LOG=N

Review URL: https://codereview.chromium.org/1727773002

Cr-Commit-Position: refs/heads/master@{#34245}
2016-02-24 11:04:22 +00:00
..
archive.py [Swarming] work around slow calls in archive.py 2016-02-24 11:04:22 +00:00
harness-adapt.js [test] Copy test262-es6 into test262. 2015-09-25 13:03:36 +00:00
list.py [Swarming] Speed up test262 upload/download. 2016-02-19 14:41:29 +00:00
README Make test262 README file revision independent. 2015-11-04 10:52:44 +00:00
test262.gyp [Swarming] Speed up test262 upload/download. 2016-02-19 14:41:29 +00:00
test262.isolate [Swarming] Speed up test262 upload/download. 2016-02-19 14:41:29 +00:00
test262.status Ensure Array.prototype.indexOf returns +0 rather than -0 2016-02-23 23:33:25 +00:00
testcfg.py [Swarming] Speed up test262 upload/download. 2016-02-19 14:41:29 +00:00

This directory contains code for binding the test262 test suite
into the v8 test harness. The tests are checked out as a dependency from

  https://chromium.googlesource.com/external/github.com/tc39/test262

at a revision specified in the DEPS file as 'data' in this directory. They are
fetched with 'gclient sync'. To update to a newer version, please change the
DEPS file.

Using a newer version, e.g. 'deadbeef' may be possible but the tests are only
known to pass (and indeed run) with the DEPS revision. Example:

  cd data
  git fetch
  git checkout deadbeef

If you do update to a newer revision you may have to change the test
harness adapter code since it uses internal functionality from the
harness that comes bundled with the tests.  You will most likely also
have to update the test expectation file.