Patchwork hypothesis: handle "repository is unrelated" errors

login
register
mail settings
Submitter David MacIver
Date Feb. 26, 2016, 5:25 p.m.
Message ID <9dc48c7b1f25c697cfdb.1456507507@laser-shark>
Download mbox | patch
Permalink /patch/13422/
State Accepted
Headers show

Comments

David MacIver - Feb. 26, 2016, 5:25 p.m.
# HG changeset patch
# User David R. MacIver <david@drmaciver.com>
# Date 1456507454 0
#      Fri Feb 26 17:24:14 2016 +0000
# Node ID 9dc48c7b1f25c697cfdb84afc8d9a4304496be46
# Parent  9a28035d39f02fc7e03d0d376ce66998628a6877
hypothesis: handle "repository is unrelated" errors

These can validly occur if the source repository has had its history
entirely rewritten and thus there are no longer any commits in
common.
Martin von Zweigbergk - Feb. 26, 2016, 5:28 p.m.
On Fri, Feb 26, 2016 at 9:25 AM, David R. MacIver <david@drmaciver.com> wrote:
> # HG changeset patch
> # User David R. MacIver <david@drmaciver.com>
> # Date 1456507454 0
> #      Fri Feb 26 17:24:14 2016 +0000
> # Node ID 9dc48c7b1f25c697cfdb84afc8d9a4304496be46
> # Parent  9a28035d39f02fc7e03d0d376ce66998628a6877
> hypothesis: handle "repository is unrelated" errors
>
> These can validly occur if the source repository has had its history
> entirely rewritten and thus there are no longer any commits in
> common.

Does this mean that tests may be failing before this patch? Or will
they start failing without this patch if you apply one of your future
patches? If the latter, I'd prefer if you include this in that future
patch.
David MacIver - Feb. 26, 2016, 5:37 p.m.
The former. It happened with low enough probability that it hadn't
previously come up, but it did in a run earlier.

This is unfortunately the downside of this style of testing. :-(

On 26 February 2016 at 17:28, Martin von Zweigbergk <martinvonz@google.com>
wrote:

> On Fri, Feb 26, 2016 at 9:25 AM, David R. MacIver <david@drmaciver.com>
> wrote:
> > # HG changeset patch
> > # User David R. MacIver <david@drmaciver.com>
> > # Date 1456507454 0
> > #      Fri Feb 26 17:24:14 2016 +0000
> > # Node ID 9dc48c7b1f25c697cfdb84afc8d9a4304496be46
> > # Parent  9a28035d39f02fc7e03d0d376ce66998628a6877
> > hypothesis: handle "repository is unrelated" errors
> >
> > These can validly occur if the source repository has had its history
> > entirely rewritten and thus there are no longer any commits in
> > common.
>
> Does this mean that tests may be failing before this patch? Or will
> they start failing without this patch if you apply one of your future
> patches? If the latter, I'd prefer if you include this in that future
> patch.
>
Martin von Zweigbergk - Feb. 26, 2016, 5:42 p.m.
On Fri, Feb 26, 2016 at 9:37 AM, David MacIver <david@drmaciver.com> wrote:
> The former. It happened with low enough probability that it hadn't
> previously come up, but it did in a run earlier.

I had not yet pushed your previous patches to the clowncopter, so I
just rolled this patch into "testing: test multiple repositories with
Hypothesis". Thanks.

>
> This is unfortunately the downside of this style of testing. :-(
>
> On 26 February 2016 at 17:28, Martin von Zweigbergk <martinvonz@google.com>
> wrote:
>>
>> On Fri, Feb 26, 2016 at 9:25 AM, David R. MacIver <david@drmaciver.com>
>> wrote:
>> > # HG changeset patch
>> > # User David R. MacIver <david@drmaciver.com>
>> > # Date 1456507454 0
>> > #      Fri Feb 26 17:24:14 2016 +0000
>> > # Node ID 9dc48c7b1f25c697cfdb84afc8d9a4304496be46
>> > # Parent  9a28035d39f02fc7e03d0d376ce66998628a6877
>> > hypothesis: handle "repository is unrelated" errors
>> >
>> > These can validly occur if the source repository has had its history
>> > entirely rewritten and thus there are no longer any commits in
>> > common.
>>
>> Does this mean that tests may be failing before this patch? Or will
>> they start failing without this patch if you apply one of your future
>> patches? If the latter, I'd prefer if you include this in that future
>> patch.
>
>

Patch

diff -r 9a28035d39f0 -r 9dc48c7b1f25 tests/test-verify-repo-operations.py
--- a/tests/test-verify-repo-operations.py	Fri Feb 26 17:15:49 2016 +0000
+++ b/tests/test-verify-repo-operations.py	Fri Feb 26 17:24:14 2016 +0000
@@ -433,7 +433,10 @@ 
 
     @rule()
     def pull(self, repo=repos):
-        with acceptableerrors("repository default not found"):
+        with acceptableerrors(
+            "repository default not found",
+            "repository is unrelated",
+        ):
             self.hg("pull")
 
     @rule(newbranch=st.booleans())