doanduyhai / Achilles

An advanced Java Object Mapper/Query DSL generator for Cassandra
http://achilles.archinnov.info
Apache License 2.0
241 stars 92 forks source link

TestEntityWithStaticAnnotations::should_find_using_static_consistency is also flaky #310

Closed flakycov closed 7 years ago

flakycov commented 7 years ago

TestEntityWithStaticAnnotations::should_find_using_static_consistency flakes on the latest master, 7c9547c:

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 10.383 sec <<< FAILURE! - in info.archinnov.achilles.it.TestEntityWithStaticAnnotations
should_find_using_static_consistency(info.archinnov.achilles.it.TestEntityWithStaticAnnotations)  Time elapsed: 0.428 sec  <<< FAILURE!
java.lang.AssertionError:
Expecting actual not to be null
       at info.archinnov.achilles.it.TestEntityWithStaticAnnotations.should_find_using_static_consistency(TestEntityWithStaticAnnotations.java:164)

The problem seems to be a race between executing "EntityWithStaticAnnotations/insert_single_row.cql" and checking its results: the check may happen before the statement finishes executing. Two other tests in this class use "Thread.sleep(1000)" to reduce this flakiness. However, two tests don't have the sleep and can flake more often (about 6% of our runs).