Clojure

[spec] Reduce collection generator default size from 20

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.9
  • Fix Version/s: Release 1.11
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Incomplete

Description

In general I find that it is very easy (especially with nested or recursive collections) to have a check run OOME due to generating very large nested collections. Currently the default is 20 - I think we should change it to 3.

The attached patch just changes the default from 20 to 3. An alternate approach would be to change it to a dynvar setting.

Patch: clj-2102-3.patch

  1. clj-2102.patch
    25/Jan/17 9:36 AM
    1 kB
    Alex Miller
  2. clj-2102-2.patch
    07/Apr/17 3:45 PM
    1 kB
    Alex Miller
  3. clj-2102-3.patch
    10/May/17 12:54 PM
    2 kB
    Alex Miller

Activity

Hide
Alex Miller added a comment -

Updated patch to apply to master

Show
Alex Miller added a comment - Updated patch to apply to master
Hide
Alex Miller added a comment -

Updated patch to apply to spec.alpha

Show
Alex Miller added a comment - Updated patch to apply to spec.alpha
Hide
Stuart Halloway added a comment -

I have definitely seen the pain here – nested collections can get big fast. OTOH for non-nested collections the larger generator is nice. Not sure moving the default is a help.

Show
Stuart Halloway added a comment - I have definitely seen the pain here – nested collections can get big fast. OTOH for non-nested collections the larger generator is nice. Not sure moving the default is a help.
Hide
Alex Miller added a comment -

Use dynamic var and reduce default. Also consider ways to avoid this kind of problem in test.check itself (how does quickcheck deal with this?).

Show
Alex Miller added a comment - Use dynamic var and reduce default. Also consider ways to avoid this kind of problem in test.check itself (how does quickcheck deal with this?).

People

Vote (3)
Watch (0)

Dates

  • Created:
    Updated: