Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't terminate when an exception happens and an agent was used #336

Closed
vincentbernat opened this issue Nov 4, 2015 · 4 comments
Closed

Comments

@vincentbernat
Copy link

Hey!

Here is a simple test case:

(ns kalzone.clock-test
  (:use midje.sweet))

(facts "about mock clock"
  (fact "a schedule can be scheduled and triggered from a callback"
    (let [ticker (agent 0)]
      (send ticker inc))))

(facts "about something else"
  (fact "something else"
    (throw (ex-info "nooo" {}))))

When running, I get the exception and the tests don't terminate. If I put the throw into a test (like => anything), the exception is correctly handled and the test terminate. I don't see an easy workaround as I cannot just call shutdown-agents whenever I get a problem since this cannot be reverted.

@vincentbernat
Copy link
Author

Wrapping the facts in deftest works as expected. However, I am using (change-defaults :print-level :print-facts) and getting the output in sync with debug logs helps debugging issues. Using deftest enables some buffering for the stuff printed out by Midje: I get the debug outputs first, then the Midje output.

@vincentbernat
Copy link
Author

In fact, this issue is a duplicate of #302.

@marick
Copy link
Owner

marick commented Dec 13, 2015

Sorry that I can't promise any fix any time soon.

@marick
Copy link
Owner

marick commented Dec 13, 2015

Closing this as a duplicate, but left a reminder to look here on the other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants