Skip to content

Commit 2cd524b

Browse files
author
Matthias Radestock
committed
deal with race condition in testing for channel closure
The client may receive & process the channel.close before txCommit is invoked, in which case an AlreadyClosedException is thrown rather than the expected IOException (which is what you get when the channel.close is handled later).
1 parent dcdf070 commit 2cd524b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/src/com/rabbitmq/client/test/functional/TransactionsBase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import java.io.IOException;
3535

36+
import com.rabbitmq.client.AlreadyClosedException;
3637
import com.rabbitmq.client.GetResponse;
3738
import com.rabbitmq.client.AMQP.BasicProperties;
3839

@@ -256,7 +257,9 @@ public void testUnknownTagAck()
256257
try {
257258
txCommit();
258259
fail("expected exception");
259-
} catch (IOException e) {}
260+
}
261+
catch (IOException e) {}
262+
catch (AlreadyClosedException e) {}
260263
connection = null;
261264
openConnection();
262265
}

0 commit comments

Comments
 (0)