This is an archive of the discontinued Mercurial Phabricator instance.

test-remotefilelog-datapack: improve testPacksCache test case
AbandonedPublic

Authored by quark on Nov 15 2017, 4:38 PM.
Tags
None
Subscribers

Details

Reviewers
singhsrb
durham
Group Reviewers
Restricted Project
Summary

This patch fixes 2 things:

  1. cdatapack is not tested within fastdatapacktests.testPacksCache
  2. python datapack may exceed fd limit

And restores the test to use as many pack files as it was before c66406 to
exercise the extreme case.

2 was fixed by replacing mmap.mmap to a thin mmap implementation that does
not keep a fd internally. The new thin mmap implementation only supports
mmapobj[a:b], so unpack_from was changed to unpack.

Test Plan

ulimit -n 50 and run ./scripts/unit.py

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark created this revision.Nov 15 2017, 4:38 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 15 2017, 4:38 PM
quark edited the summary of this revision. (Show Details)Nov 15 2017, 5:26 PM
quark updated this revision to Diff 3537.
singhsrb requested changes to this revision.EditedNov 15 2017, 5:51 PM
singhsrb added a subscriber: singhsrb.

Does this actually fix the test? I say that because the limit is somehow 256 and when I check the number of open files for this test, it is >400 irrespective of whether we use the datapack or the fastdatapack.

This revision now requires changes to proceed.Nov 15 2017, 5:51 PM

The test doesn't pass for me after ulimit -n 256

quark updated this revision to Diff 3547.Nov 15 2017, 9:02 PM
quark added a comment.Nov 15 2017, 9:04 PM

The test doesn't pass for me after ulimit -n 256

Should be fixed now - the old code was not using the cdatapack code path.

singhsrb accepted this revision.Nov 15 2017, 9:06 PM

It even worked with ulimit -n 128 now. This should fix the test. Thanks for taking care of this!

This revision is now accepted and ready to land.Nov 15 2017, 9:06 PM

You will probably need to change the title and description of this commit somewhat to reflect what the code is actually doing now.

quark edited the summary of this revision. (Show Details)Nov 16 2017, 12:36 PM
quark edited the test plan for this revision. (Show Details)
quark retitled this revision from test-remotefilelog-datapack: be windows and osx friendly to test-remotefilelog-datapack: do not fail with small fd limit.
durham requested changes to this revision.Nov 16 2017, 12:59 PM
durham added a subscriber: durham.

Let's just fix the test to not create 100+ pack files. No point in reducing our test coverage for something easily fixable.

This revision now requires changes to proceed.Nov 16 2017, 12:59 PM
quark edited the summary of this revision. (Show Details)Nov 16 2017, 7:08 PM
quark edited the test plan for this revision. (Show Details)
quark retitled this revision from test-remotefilelog-datapack: do not fail with small fd limit to test-remotefilelog-datapack: improve testPacksCache test case.
quark updated this revision to Diff 3584.

I'm not sure we should use a completely custom mmap implementation. I don't know if the python mmap implementation is handling subtle edge cases or anything for us. I'd rather not move off the time tested implementation just for this edge case that only appears in a test or horribly broken repositories. If you do want to land this, let's put it behind a config flag and turn it on for our team for a bit first.

durham requested changes to this revision.Nov 16 2017, 7:16 PM
This revision now requires changes to proceed.Nov 16 2017, 7:16 PM
quark abandoned this revision.Nov 16 2017, 7:28 PM

Suppressed by D1442.