test.check

shrinking/test running treat ctrl-c (InterruptedException) as

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

If you're testing a long running or blocking test (for example, I've been
working on finding race conditions with state machines ala John Hughes' keynote
at clojure west), it's very frustrating to not be able to ctrl-c tests when
they're blocking/stalled/slow. This is because the shrinking/running processes
are naive, and only catch Exception, without special casing
InterruptedException.

I'd very much like to see this fixed - it's a blocker on me actually using
test.check on my project, and very definitely a blocker on the race
condition/state machine work I've been doing. I've had a couple of runs at it,
but got pretty confused at aborting the shrink correctly (likely that's me
being dumb though).

To reproduce:

(tc/quick-check (prop/for-all [a (gen/any)] (Thread/sleep 10000)))

I'd expect to see:

the test run finishes

What happens instead:

test.check treats the InterruptedException as a failure and continues shrinking
as though that run had failed.

Activity

Hide
Reid Draper added a comment -

Agree. I have some ideas about what the best longterm solution is here, but am still a bit fuzzy. That being said, I think there are some simple incremental solutions that can help people now. I'll take a stab at something this week and gather some feedback.

Show
Reid Draper added a comment - Agree. I have some ideas about what the best longterm solution is here, but am still a bit fuzzy. That being said, I think there are some simple incremental solutions that can help people now. I'll take a stab at something this week and gather some feedback.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: