Commit d62518d
committed
Remove test for Connection #finalize
This hurts bad to do, and I'm open to any suggestion for how to
do this test in a way that is deterministic.
Whenever #finalize is called on a user-level Session object,
we check that the session was properly closed. If it was not
closed, we generate an error and close the session.
The test for this would create a Session object with no references,
and then run tens of thousands of iterations of System.gc(),
testing for #close() being invoked. This seems to have worked
deterministically on Java 8, but on Java 7 it is flaky.
I don't think testing for Java 7 in a JUnit assumption is
a good solution, and instead I'm opting for removing the test,
with the argument that this has been manually verified to work,
it is a best-effort piece of code that in production usage is
allowed to fail (since we can never guarante the finalizer will
invoke us).
If we drop java 7 support, we could look at reverting this commit.1 parent 91f79c7 commit d62518d
File tree
2 files changed
+1
-85
lines changed- driver/src
- main/java/org/neo4j/driver/internal
- test/java/org/neo4j/driver/internal
2 files changed
+1
-85
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
Lines changed: 0 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 25 | | |
29 | 26 | | |
30 | | - | |
31 | | - | |
32 | 27 | | |
33 | | - | |
34 | 28 | | |
35 | 29 | | |
36 | 30 | | |
37 | | - | |
38 | 31 | | |
39 | | - | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
| |||
143 | 135 | | |
144 | 136 | | |
145 | 137 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | 138 | | |
0 commit comments