Clojure

Make some Clojure tests independent of hash function used

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.6
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

The most interesting failures with the new hash function are probably the 3 deftest's in multimethods.clj that define the same multimethod name 'simple', and thus whether they pass or fail depends upon the order that they are executed. They are currently executed in an order that allows them to pass. Found this while testing murmurHash3 changes to Clojure, which caused the deftest's to execute in a different order and fail.

Simplest way to eliminate this dependency on order is to make the multimethod names unique in each test, so none of them depends upon state left behind by the others.

  1. clj-1328-v3.diff
    29/Jan/14 10:52 PM
    6 kB
    Andy Fingerhut
  2. clj-1328-v4.diff
    31/Jan/14 3:43 PM
    6 kB
    Andy Fingerhut

Activity

Hide
Andy Fingerhut added a comment -

Patch clj-1328-v1.diff makes all defmulti names unique in multimethods.clj, so that no deftest result depends upon state left behind by another.

Show
Andy Fingerhut added a comment - Patch clj-1328-v1.diff makes all defmulti names unique in multimethods.clj, so that no deftest result depends upon state left behind by another.
Hide
Andy Fingerhut added a comment -

Updates some, but not all, tests that were recently modified or disabled due to change in hash function.

Show
Andy Fingerhut added a comment - Updates some, but not all, tests that were recently modified or disabled due to change in hash function.
Hide
Andy Fingerhut added a comment -

Updates one more test than the previous patch.

Show
Andy Fingerhut added a comment - Updates one more test than the previous patch.
Hide
Andy Fingerhut added a comment -

clj-1328-v4.diff is identical to clj-1328-v3.diff, except it adds a comment explaining why the case hash collision tests don't need to change much, and it puts in a couple of missing (is ...) around some equality tests.

Show
Andy Fingerhut added a comment - clj-1328-v4.diff is identical to clj-1328-v3.diff, except it adds a comment explaining why the case hash collision tests don't need to change much, and it puts in a couple of missing (is ...) around some equality tests.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: