Summary: | Tests in Output_JSON.t make invalid assumptions | ||
---|---|---|---|
Product: | Koha | Reporter: | Colin Campbell <colin.campbell> |
Component: | Test Suite | Assignee: | Colin Campbell <colin.campbell> |
Status: | CLOSED FIXED | QA Contact: | Galen Charlton <gmcharlt> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Proposed Patch
Bug 11480 Fix invalid assumptions in test Bug 11480 Fix invalid assumptions in test |
Description
Colin Campbell
2014-01-06 16:51:44 UTC
Created attachment 23973 [details] [review] Proposed Patch Without this patch the test script is run with perl 5.18 will fail on 0 to 3 tests. (0 is a hard one to spot!) differing on every run. With this patch the results will be consistent Created attachment 23981 [details] [review] Bug 11480 Fix invalid assumptions in test Tests for Output::JSON made the invalid assumption that the hash keys of the modules internal structure will always be returned in the same sequence. A hash is an unordered structure. as of perl 5.18 this has beem reinforced by random seeding of the hashing function. See the info in perldelta and the doc for JSON This patch changes the tests to be sequence neutral where the previous test was testing that a new element was added and an existing one was untouched these have been separated into individual tests. Some typos in the messages have been corrected Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Test Plan 1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail, but inconsistently under perl 5.18 or greater) 2/ Apply patch 3/ Run t/Output_JSONStream.t 10 tests should pass now Created attachment 24136 [details] [review] Bug 11480 Fix invalid assumptions in test Tests for Output::JSON made the invalid assumption that the hash keys of the modules internal structure will always be returned in the same sequence. A hash is an unordered structure. as of perl 5.18 this has beem reinforced by random seeding of the hashing function. See the info in perldelta and the doc for JSON This patch changes the tests to be sequence neutral where the previous test was testing that a new element was added and an existing one was untouched these have been separated into individual tests. Some typos in the messages have been corrected Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Test Plan 1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail, but inconsistently under perl 5.18 or greater) 2/ Apply patch 3/ Run t/Output_JSONStream.t 10 tests should pass now Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master. Thanks, Colin! |