Fix intermittent SRP Pub/Sub test failures

SRP unsubscribes asynchronously, so occasionally not all messages were delivered prior to unsubscribe. Test will now unsubscribe on connection close instead.
This commit is contained in:
Jennifer Hickey
2013-03-13 22:15:37 -07:00
parent 223ec79c7e
commit a406417efd
2 changed files with 17 additions and 9 deletions

View File

@@ -52,6 +52,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* {@code RedisConnection} implementation on top of <a href="https://github.com/spullara/redis-protocol">spullara Redis Protocol</a> library.
*
* @author Costin Leau
* @author Jennifer Hickey
*/
public class SrpConnection implements RedisConnection {
@@ -139,6 +140,11 @@ public class SrpConnection implements RedisConnection {
isClosed = true;
queue.remove(this);
if (subscription != null) {
subscription.doClose();
subscription = null;
}
try {
client.close();
} catch (IOException ex) {