Commit 6072a1d
authored
Bump version to
## Problem
We need to bump version packaging and constants for releasing v6.2.0.
There's also a significant amount of integration test flakiness to
address, and the suite was taking ~20 minutes to run.
## Solution
**Version bump**
Bump version to 6.2.0 in `gradle.properties` and `CHANGELOG.md`.
**NOTE: All of the following changes are within the integration testing
harness, so none of the client code is actually touched. I spent a bit
of time working with claude to tighten up the testing harness itself.
Test execution went from 20-24mins per run to 7-8mins, it looks like.
Primarily, this was achieved through parallelizing the test classes
since a lot of them are reusing the TestResourcesManagerSingle already.
The singleton class also needed a lot of work to make it a bit more
robust when being accessed by parallel testing threads. I summarized
most of this with claude since it was done across numerous commits.**
**Parallel test execution**
Added `junit-platform.properties` enabling concurrent class-level
execution at parallelism 4, with methods within each class remaining
sequential. This alone brought the suite runtime from ~20 minutes to ~8
minutes.
**AssertRetry — exception handling gap**
The retry helper only caught `AssertionError`, `ExecutionException`, and
`IOException`. Any other exception (most commonly `NullPointerException`
when a namespace key is absent from the stats map during eventual
consistency) escaped the retry loop immediately. Widened the catch and
the `AssertionRunnable` interface to `Exception`. Also added
explicit `InterruptedException` re-throw before the broad catch so that
cancellation signals propagate correctly rather than being silently
retried.
**TestResourcesManager — thread safety**
Enabling parallel class execution exposed multiple races in the shared
singleton:
- `getInstance()` was unsynchronized; two classes could both see `null`
and construct duplicate instances. Fixed with `volatile` +
`synchronized`.
- `getOrCreatePodIndex()`, `getOrCreateServerlessIndex()`, and
`getOrCreateCollection()` had check-then-act races where two threads
could both pass the null guard and create duplicate indexes. All marked
`synchronized`.
- `getOrCreate*Connection()` methods now cache their results and are
`synchronized`, ensuring parallel classes that both call
`getOrCreateServerlessIndexConnection()` share the same `Index` object
rather than creating duplicate channels.
- `cleanupResources()` now closes all cached connections before deleting
indexes.
- Fixed a string identity comparison bug (`!= "ready"`) in the
collection-readiness loop that caused it to always run to the full
120-second timeout. Fixed to `!"ready".equals(...)`.
**Parallel tests closing shared connections early**
`Index.close()` shuts down the underlying `PineconeConnection`, which is
shared via a `static final ConcurrentHashMap` keyed by index name across
all `Pinecone` instances. With parallel class execution, one class
calling `close()` in `@AfterAll` could terminate the channel while
another class was mid-request. Removed `close()` calls from
`@AfterAll` in all test classes that obtained connections from
`TestResourcesManager`. Connections are now closed exclusively in
`TestResourcesManager.cleanupResources()` at the end of the run.
**ResponseMetadata tests — static connection map race**
The `ResponseMetadata*` tests create their own `Pinecone` client with a
listener interceptor, but `getIndexConnection()` uses `computeIfAbsent`
on the shared static map — whichever class first creates a connection
for the shared index name wins. If another class won the race, the
`ResponseMetadata*` tests got a listener-less connection and
captured nothing. Fixed by constructing `PineconeConnection` directly
(bypassing `computeIfAbsent`) using a host exposed via
`TestResourcesManager.getOrCreateServerlessIndexHost()`. Each
`ResponseMetadata*` test now owns its connection and closes it in its
own `@AfterAll`.
**UpsertDescribeIndexStatsAndDeletePodTest / ...ServerlessTest — shared
mutable counter**
A `static namespaceVectorCount` field was shared and mutated across all
test methods. Each test now creates its own isolated namespace and
tracks its own local count, with null-safe assertions for the case where
a deleted namespace is removed from the stats map.
**NamespacesTest — cross-test namespace count interference**
Both sync and async tests asserted on exact total namespace counts
against the same shared index. Each test now uses a unique random prefix
and counts only its own namespaces via prefix-filtered `listNamespaces`,
making assertions fully isolated. `Thread.sleep` replaced with
`assertWithRetry`. Async upserts now properly await with `.get()`.
**ListEndpointTest — concurrent write interference**
Count assertions against the shared serverless index were vulnerable to
concurrent writes from parallel classes inflating the results. All
assertions now use prefix-filtered `list()` calls that only count
vectors seeded by `TestResourcesManager` under known prefixes.
**ReadCapacityAndSchemaTest — unnecessary waits + missing cleanup**
Removed `waitUntilIndexIsReady` from tests 1–5 (assertions are on the
create response, not index state). Added `@AfterAll` that deletes all
indexes created by the class, with logged warnings on deletion failure
rather than silent swallowing.
**ConfigureIndexTest — parallel isolation**
Added `@Isolated` since this test mutates a shared pod index's replica
count and pod type, which cannot safely run concurrently with any other
class. Also fixed a string identity comparison (`!= "ready"`) in the
local readiness poll.
**ConnectionsMapTest — size assertions replaced**
`assertEquals(size, 1)` / `assertEquals(size, 2)` assumed the static map
contained only this test's entries, which breaks under parallel
execution when other classes have their own connections in the map.
Replaced with key-presence checks (`assertFalse(containsKey(...))`) and
object-identity checks (`assertSame`) to verify connection reuse without
counting map entries. Also replaced bare `assert` keywords (silently
skipped without `-ea`) with `assertFalse`/`assertSame`. Fixed a
pre-existing typo where `config1.setHost(host2)` was overwriting the
wrong config.
**UpsertAndSearchRecordsTest — cleanup masking failures**
`createIndexForModel` was called before the `try` block, so if it failed
the `finally` clause would call `deleteIndex` on a non-existent index,
replacing the original exception with a not-found error. Moved creation
inside `try` with an `indexCreated` flag so `deleteIndex` only runs when
there is actually an index to clean up. Also replaced
hardcoded sleeps with `waitUntilIndexIsReady` and `assertWithRetry`.6.2.0, resolve integration test flakiness (#219)1 parent e57171b commit 6072a1d
File tree
22 files changed
+473
-562
lines changed- src
- integration
- java/io/pinecone
- clients
- helpers
- integration
- controlPlane
- pod
- serverless
- dataPlane
- resources
- main/java/io/pinecone/commons
22 files changed
+473
-562
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 18 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
124 | 105 | | |
125 | 106 | | |
126 | 107 | | |
127 | 108 | | |
128 | 109 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
134 | 113 | | |
135 | 114 | | |
136 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | | - | |
| 9 | + | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
16 | | - | |
| 13 | + | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| |||
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
Lines changed: 58 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
188 | | - | |
189 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
| |||
195 | 213 | | |
196 | 214 | | |
197 | 215 | | |
198 | | - | |
199 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
200 | 221 | | |
201 | 222 | | |
202 | 223 | | |
| |||
205 | 226 | | |
206 | 227 | | |
207 | 228 | | |
208 | | - | |
209 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
| |||
215 | 239 | | |
216 | 240 | | |
217 | 241 | | |
218 | | - | |
219 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
220 | 247 | | |
221 | 248 | | |
222 | 249 | | |
| |||
225 | 252 | | |
226 | 253 | | |
227 | 254 | | |
228 | | - | |
| 255 | + | |
229 | 256 | | |
230 | 257 | | |
231 | 258 | | |
| |||
236 | 263 | | |
237 | 264 | | |
238 | 265 | | |
239 | | - | |
| 266 | + | |
240 | 267 | | |
241 | 268 | | |
242 | 269 | | |
| |||
247 | 274 | | |
248 | 275 | | |
249 | 276 | | |
250 | | - | |
| 277 | + | |
251 | 278 | | |
252 | 279 | | |
253 | 280 | | |
| |||
257 | 284 | | |
258 | 285 | | |
259 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
260 | 300 | | |
261 | 301 | | |
262 | 302 | | |
| |||
280 | 320 | | |
281 | 321 | | |
282 | 322 | | |
283 | | - | |
| 323 | + | |
284 | 324 | | |
285 | 325 | | |
286 | 326 | | |
| |||
311 | 351 | | |
312 | 352 | | |
313 | 353 | | |
314 | | - | |
| 354 | + | |
315 | 355 | | |
316 | 356 | | |
317 | 357 | | |
| |||
344 | 384 | | |
345 | 385 | | |
346 | 386 | | |
347 | | - | |
| 387 | + | |
348 | 388 | | |
349 | 389 | | |
350 | 390 | | |
| |||
359 | 399 | | |
360 | 400 | | |
361 | 401 | | |
362 | | - | |
| 402 | + | |
363 | 403 | | |
364 | 404 | | |
365 | 405 | | |
366 | 406 | | |
367 | 407 | | |
368 | | - | |
| 408 | + | |
369 | 409 | | |
370 | 410 | | |
371 | 411 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
0 commit comments