Commit 4cbf3eb
committed
Stabilize
The test method `will_cache_invalid_cql` is inherently flaky due to the
usage of weak valued cache. This is a quick workaround that should
achieve the same end result as the setup in PreparedStatementCachingIT.
Here we use reflection to forcibly change the cache used by the
request processor.
The alternatives are: reimplementing similar setup as in
PreparedStatementCachingIT with some changes. That means
having a test version of DefaultDriverContext, CqlPrepareAsyncProcessor,
SessionBuilder and necessary methods.
The other option is moving this test method to the PreparedStatementCachingIT,
but then the cache's remove callback which is used there needs to be adjusted,
otherwise the test will still be flaky, but with different cause. The
server-side error about invalid syntax can occasionally break the remove
callback.PreparedStatementCancellationIT#will_cache_invalid_cql
1 parent c7cee1f commit 4cbf3eb
1 file changed
Lines changed: 11 additions & 0 deletions
File tree
- integration-tests/src/test/java/com/datastax/oss/driver/core/cql
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
| |||
0 commit comments