Skip Menu |

This queue is for tickets about the Messaging-Message CPAN distribution.

Report information
The Basics
Id: 87341
Status: resolved
Priority: 0/
Queue: Messaging-Message

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.4
Fixed in: (no value)

Attachments
Messaging-Message-1.4-Force-fixed-JSON-ordering-in-tests.patch



Subject: t/2queue.t tests fail with perl 5.18
t/2queue.t tests fail due to randomized hashes in perl 5.18: t/2queue.t ...... 1/23 # Failed test 'add+get' # at t/2queue.t line 23. # got: '{"encoding":"base64","body":"e3p5eH9+fXxzcnFwd3Z1dGtqaWhvbm1sY2JhYGdmZWRbWllYX15dXFNSUVBXVlVUS0pJSE9OTUxDQkFAR0ZFRDs6OTg/Pj08MzIxMDc2NTQrKikoLy4tLCMiISAnJiUkGxoZGB8eHRwTEhEQFxYVFAsKCQgPDg0MAwIBAAcGBQT7+vn4//79/PPy8fD39vX06+rp6O/u7ezj4uHg5+bl5Nva2djf3t3c09LR0NfW1dTLysnIz87NzMPCwcDHxsXEu7q5uL++vbyzsrGwt7a1tKuqqaivrq2so6KhoKempaSbmpmYn56dnJOSkZCXlpWUi4qJiI+OjYyDgoGAh4aFhA=="}' # expected: '{"body":"e3p5eH9+fXxzcnFwd3Z1dGtqaWhvbm1sY2JhYGdmZWRbWllYX15dXFNSUVBXVlVUS0pJSE9OTUxDQkFAR0ZFRDs6OTg/Pj08MzIxMDc2NTQrKikoLy4tLCMiISAnJiUkGxoZGB8eHRwTEhEQFxYVFAsKCQgPDg0MAwIBAAcGBQT7+vn4//79/PPy8fD39vX06+rp6O/u7ezj4uHg5+bl5Nva2djf3t3c09LR0NfW1dTLysnIz87NzMPCwcDHxsXEu7q5uL++vbyzsrGwt7a1tKuqqaivrq2so6KhoKempaSbmpmYn56dnJOSkZCXlpWUi4qJiI+OjYyDgoGAh4aFhA==","encoding":"base64"}' This is because the tests compare strings serialized with $_JSON->encode() which does not guarantee ordering. JSON->canonical() enabled fixed ordering, but it has significant overhead. Running the tests with PERL_PERTURB_KEYS=0 environment variable confirms this issue is caused with randomized hashes.
From: ppisar [...] redhat.com
Dne Pá 26.čec.2013 03:50:40, ppisar napsal(a): Show quoted text
> t/2queue.t tests fail due to randomized hashes in perl 5.18: >
Attached patch fixes it. -- Petr
Subject: Messaging-Message-1.4-Force-fixed-JSON-ordering-in-tests.patch
From 4616ac01ae92dc9275c6b0ec425856219d850dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 26 Jul 2013 09:54:52 +0200 Subject: [PATCH] Force fixed JSON ordering in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <https://rt.cpan.org/Public/Bug/Display.html?id=87341> Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/2queue.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/2queue.t b/t/2queue.t index 935cbf3..52b2f26 100644 --- a/t/2queue.t +++ b/t/2queue.t @@ -10,6 +10,9 @@ use Test::More tests => 23; our($tmpdir, $binstr, $unistr); +# Force fixed ordering, CPAN RT#87341 +$Messaging::Message::_JSON->canonical(1); + sub test_m ($$) { my($mq, $msg) = @_; my($str1, $str2, $elt); -- 1.8.1.4
I've fixed the testing script in 1.4_1. It would be great if you could check if it works as I don't have access to a machine with Perl 5.18...
Subject: Re: [rt.cpan.org #87341] t/2queue.t tests fail with perl 5.18
Date: Tue, 30 Jul 2013 12:59:15 +0200
To: Lionel Cons via RT <bug-Messaging-Message [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Tue, Jul 30, 2013 at 06:33:47AM -0400, Lionel Cons via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=87341 > > > I've fixed the testing script in 1.4_1. It would be great if you could check > if it works as I don't have access to a machine with Perl 5.18...
Great. I run the tests multiple times and it never failed. -- Petr
Download (untitled)
application/pgp-signature 230b

Message body not shown because it is not plain text.

Fixed in 1.4_1.