You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some tests where I need to set a specific timeout, say to assert that something does timeout. But it seems when we run tests through CI, I can't control what timeout set for which tests.
Normally I do:
(do
(rcf/set-timeout! 200)
(tests "That it times out"
...))
But like I said, I feel this doesn't generate a deftest that will execute with a 200ms timeout always.
The text was updated successfully, but these errors were encountered:
What platform, JVM? Can you demonstrate it? Please confirm this is under clojure.test integration only ({:jvm-opts ["-Dhyperfiddle.rcf.generate-tests=true"]}), cannot reproduce without that flag?
I'll try and see if I can find a minimal way to reproduce.
It's on JDK 17, OpenSuse tumbleweed Linux.
It's not actually on CI, just running clojure -X:test locally with cognitect test runner.
I did set the flag above, as well as the omit stack trace flag.
I believe the issue is that clojure.test doesn't guarantee the test order without an explicit test-ns-hook or something like that.
So the set-timeouts! are not executed prior to each test as they are defined in the test file. So if you have many tests, each one needing a different timeout, you can't control which test is executed with what timeout when running the tests with a test runner for clojure.test.
dustingetz
changed the title
set-timeout! issue in CI
rcf/set-timeout! incompatible with clojure.test which doesn't guarantee test order
Jan 2, 2024
I have some tests where I need to set a specific timeout, say to assert that something does timeout. But it seems when we run tests through CI, I can't control what timeout set for which tests.
Normally I do:
But like I said, I feel this doesn't generate a deftest that will execute with a 200ms timeout always.
The text was updated successfully, but these errors were encountered: