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.
Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-1328-v1.diff [ 12710 ]
Andy Fingerhut made changes -
Patch Code and Test [ 10002 ]
Andy Fingerhut made changes -
Description 3 deftest's in multimethods.clj 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.
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.
Summary Some multimethods tests pass/fail changes depending upon order deftest's are executed Make some Clojure tests independent of hash function used
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.
Andy Fingerhut made changes -
Attachment clj-1328-v2.diff [ 12728 ]
Andy Fingerhut made changes -
Attachment clj-1328-v1.diff [ 12710 ]
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.
Andy Fingerhut made changes -
Attachment clj-1328-v3.diff [ 12729 ]
Andy Fingerhut made changes -
Attachment clj-1328-v2.diff [ 12728 ]
Alex Miller made changes -
Approval Vetted [ 10003 ]
Fix Version/s Release 1.6 [ 10157 ]
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.
Andy Fingerhut made changes -
Attachment clj-1328-v4.diff [ 12738 ]
Stuart Halloway made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: