[darcs-devel] shrinkPatchInfo goes into infinite loop
Ben Franksen
ben.franksen at online.de
Fri Feb 28 21:19:33 UTC 2020
Am 28.02.20 um 18:06 schrieb Ganesh Sittampalam:
> On 28/02/2020 15:56, Benjamin Franksen wrote:
>> This has cost me many many hours of unnecessary work and utter
>> frustration. Because I did not suspect the shrinker and instead thought
>> I had broken the test case generator. The test was in fact failing, as I
>> found out just now, due to a stupid mistake I made when I adapted the
>> property under test to a refactor.
>
> Oh dear, sorry about that, I'll look into it as soon as I can.
I have recovered, thanks to a good 2 hours of TaiJi ;-)
> It does reinforce my point about needing to test shrinking, I guess I
> should look at that too.
And mine about supporting alternatives to QC. I am in the process of
cleaning a few things up in the harness to disentangle Arbitrary from
other type classes.
> Do you have an example input that loops?
My change to PatchInfo was to always add the "UNDO: " prefix if
_piLegacyIsInverted is set. This made the metadataDecodingTest fail
because the raw ByteString does not have that prefix. The generator
creates that flag with 50% probability and as soon as we hit that case
(which is rather soon) the shrinker loops.
I'll send my patch. If you apply it and roll back the fixes I made to
metadataDecodingTest, you tests should loop (use darcs-test -t
Darcs.Patch.Info).
> What's the relationship with
> patch2005 which you sent a while before this email - is that a partial
> fix or somehow connected?
I don't think it is connected. I guess the problem is related to the way
you define shrink via <|> for the member of Patchinfo.
Cheers
ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 4211 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20200228/6f868fbe/attachment-0001.key>
More information about the darcs-devel
mailing list