Updates for buffer management in RSocket

- Integration tests run with zero copy configuration.
- RSocketBufferLeakTests has been added.
- Updates in MessagingRSocket to ensure proper release

See gh-21987
This commit is contained in:
Rossen Stoyanchev
2019-03-04 23:34:53 -05:00
parent 23b39ad27b
commit 9e7f557b4a
10 changed files with 581 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -105,13 +105,15 @@ public abstract class AbstractDataBufferAllocatingTestCase {
*/
protected void waitForDataBufferRelease(Duration duration) throws InterruptedException {
Instant start = Instant.now();
while (Instant.now().isBefore(start.plus(duration))) {
while (true) {
try {
verifyAllocations();
break;
}
catch (AssertionError ex) {
// ignore;
if (Instant.now().isAfter(start.plus(duration))) {
throw ex;
}
}
Thread.sleep(50);
}