Commit d4d2c75
authored
[service-bus] Closing some open areas where we could mask errors, and fixing flaky tests to be more reliable. (#15761)
Making changes to simplify a flaky test (and hopefully make it more reliable).
The main issue with the 'handle interrupted detach' method was that it relied on too many moving parts to work reliably. We could just eternally loop like we'd expect customers to do, but in the end we have a very simple test we're trying to perform - we want to receive, and while we're in the process of draining, cause a detach and have it early exit and reject/resolve immediately rather than waiting for the timeout.
I reworked the test to make that simpler by just removing the unneeded connection.idle() and just calling directly into the onDetached method. Because it happens prior to rhea even seeing that we're draining we should reliably win that race each time.
There were a couple of other things changed for this PR as well:
- The max time per test was lowered accidentally. Bringing it back what's been used as the standard time in other libraries
- Fixed a spot in receiveMessages() where, if the link had been closed, we'd falsly return an empty array instead of throwing an exception indicating the link closed. This didn't appear to be related to the bug but it's incorrect and can hide bugs so I'd rather just throw the error than eat the condition and return an empty array. It's rare, but when it does happen the empty array response isn't right either - we're probably in the middle of a connection reset/change event.
Fixes #134611 parent f9efdf4 commit d4d2c75
File tree
8 files changed
+205
-80
lines changed- sdk/servicebus/service-bus
- src/core
- test/internal
- unit
- utils
8 files changed
+205
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
| 265 | + | |
| 266 | + | |
261 | 267 | | |
262 | 268 | | |
| 269 | + | |
| 270 | + | |
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| |||
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
273 | 285 | | |
274 | 286 | | |
275 | 287 | | |
| 288 | + | |
| 289 | + | |
276 | 290 | | |
| 291 | + | |
| 292 | + | |
277 | 293 | | |
278 | 294 | | |
279 | 295 | | |
| |||
288 | 304 | | |
289 | 305 | | |
290 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
291 | 310 | | |
292 | 311 | | |
293 | 312 | | |
| |||
310 | 329 | | |
311 | 330 | | |
312 | 331 | | |
| 332 | + | |
313 | 333 | | |
314 | | - | |
315 | 334 | | |
316 | 335 | | |
317 | 336 | | |
318 | | - | |
319 | 337 | | |
| 338 | + | |
| 339 | + | |
320 | 340 | | |
321 | 341 | | |
| 342 | + | |
| 343 | + | |
322 | 344 | | |
323 | 345 | | |
324 | 346 | | |
325 | 347 | | |
326 | 348 | | |
327 | | - | |
328 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
329 | 356 | | |
330 | 357 | | |
331 | 358 | | |
| |||
0 commit comments