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

Race condition in test of "once" #13

Open
fredZen opened this issue Feb 21, 2016 · 1 comment
Open

Race condition in test of "once" #13

fredZen opened this issue Feb 21, 2016 · 1 comment

Comments

@fredZen
Copy link

fredZen commented Feb 21, 2016

This test fails occasionally: (core_test.clj lines 464-468)

(testing "once"
  (let [j (r/join (r/once 1) (r/once 2) (r/once 3))]
    (is (realized? j))
    (is (r/complete? j))
    (is (= (deref! j) 3)))))

The test fails because there is a race condition in the assertion (is (realized? j)):
if the go block underlying r/join hasn't started pumping data into j yet, then j will still be unrealized and the test will fail.

@weavejester
Copy link
Owner

Thanks for the report. This test likely needs some delay or blocking check before the realized?.

fredZen referenced this issue in chourave/reagi Mar 4, 2016
Workaround do fix a race condition: give r/join a little time to start doing its job.
fredZen referenced this issue in chourave/reagi Mar 4, 2016
Workaround do fix a race condition: give r/join a little time to start doing its job.
fredZen referenced this issue in chourave/reagi Mar 4, 2016
Workaround do fix a race condition: give r/join a little time to start doing its job.
@fredZen fredZen mentioned this issue Mar 4, 2016
fredZen referenced this issue in chourave/reagi Mar 4, 2016
Workaround do fix a race condition: give r/join a little time to start doing its job.
fredZen referenced this issue in chourave/reagi Mar 4, 2016
give r/join a little time to start doing its job
fredZen referenced this issue in chourave/reagi Mar 4, 2016
give r/join a little time to start doing its job
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