Commit 8c49326
SOLR-18188: Misc test fixes (#4496)
Accumulated from several commits on the misc-test-fixes branch.
PrepRecoveryOp: add class-level javadoc to explain its purpose.
ShowFileRequestHandlerTest, TestPrometheusResponseWriter,
TestCborDataFormat: close response streams to fix resource leaks
flagged by the test framework.
TestDistributedTracing: add retry logic around span assertions to
reduce flakiness caused by timing-sensitive telemetry delivery.
SocketProxy: call setSoTimeout(1000) on the server socket so the
accept loop unblocks promptly when close() is called. Without a
timeout the acceptor thread blocks indefinitely in accept() and
leaks, causing test hangs or "thread leaked" warnings.
JettySolrRunner: move proxy.close() to before server.stop() rather
than leaving it in the finally block. If qtp.join() hangs (e.g. stuck
PrepRecoveryOp handlers or H2C session threads) the finally block is
never reached, leaving the SocketProxy acceptor thread leaked. Closing
the proxy first ensures cleanup even when server shutdown hangs.
HttpJettySolrClientCompatibilityTest: switch from @ClassRule to @rule
so the Jetty server lifecycle is per-test as intended.
TestSolrJ: delete this file -- it contains no actual tests.
ClientUtils: add Objects.requireNonNull() guard on serverRootUrl to
surface null earlier with a clear error rather than a cryptic NPE
downstream.
AbstractFullDistribZkTestBase: wrap control-collection creation in
RetryUtil.retryOnException() to tolerate transient ZooKeeper errors
during setup. Also move coreClients.clear(),
solrClientByCollection.clear(), and super.destroyServers() into a
finally block after ExecutorUtil.shutdownAndAwaitTermination() so
teardown always completes even if the executor shutdown throws.
HttpPartitionTest: decrease leaderConflictResolveWait to 10sec so
stale PrepRecoveryOp handlers time out within the Jetty graceful stop window
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent de1e742 commit 8c49326
12 files changed
Lines changed: 105 additions & 226 deletions
File tree
- solr
- core/src
- java/org/apache/solr/handler/admin
- test/org/apache/solr
- cloud
- handler/admin
- response
- search
- util
- modules/opentelemetry/src/test/org/apache/solr/opentelemetry
- solrj-jetty/src/test/org/apache/solr/client/solrj/jetty
- solrj/src/java/org/apache/solr/client/solrj/util
- test-framework/src/java/org/apache/solr
- cloud
- embedded
- util
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| |||
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
205 | 216 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
Lines changed: 0 additions & 188 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
0 commit comments