[spec] Transient exceptions thrown in clojure.spec.test/check

Description

So far I've seen two transient exceptions from running stest/check against some very simple functions:

First, while checking this spec:

This exception was raised:

Second, while checking this spec:

This exception was thrown:

I was unable to reproduce either exception during consequent runs.

Cause: See further investigation in the comments - this appears to be caused by the pmap in check triggering concurrent requires of the test.check.generators namespace.

Approach: Add locking to prevent concurrent loads in dynaload.

Workaround: Explicitly require clojure.test.check.generators in advance. (This is gross!)

Patch: clj-2026-2.patch

Environment

Java Virtual Machine 1.8
Clojure 1.9.0-alpha12
test.check 0.9.0

Attachments

2

Activity

Alex Miller June 26, 2018 at 5:38 PM

Applied

Alex Miller May 10, 2017 at 6:52 PM

Updated patch to apply to spec.alpha

Stuart Halloway October 14, 2016 at 6:41 PM

If we are going to add locking, why not add it to ns and require in core? Wouldn't all users of require want these better semantics, or is that too expensive for general use?

See also http://dev.clojure.org/jira/browse/CLJ-1406.

Stuart Halloway October 14, 2016 at 6:41 PM

If we are going to add locking, why not add it to ns and require in core? Wouldn't all users of require want these better semantics, or is that too expensive for general use?

See also http://dev.clojure.org/jira/browse/CLJ-1406.

Alex Miller September 22, 2016 at 2:39 PM

Just a note of thanks for those that have looked at this so far - thanks! Certainly concurrent requires during dynaload sounds like a reasonable candidate. The only source of concurrency that I'm aware of is the pmap inside `check` (presuming there is not something concurrent in the original testing environment).

Completed

Details

Assignee

Reporter

Labels

Approval

Patch

Priority

Affects versions

Fix versions

Created September 21, 2016 at 6:46 PM
Updated June 26, 2018 at 5:38 PM
Resolved June 26, 2018 at 5:38 PM