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.