Skip to content

Commit

Permalink
Fix #35 failing basic batchingAllowed* tests
Browse files Browse the repository at this point in the history
Flush after enabling batching so client receives message.
Ensure batching configuration is restored to default so subsequent
messages are not
batched on the server causing the client to time out waiting for them
and the test to fail.

Signed-off-by: Mark Thomas <markt@apache.org>
  • Loading branch information
markt-asf committed Jan 30, 2019
1 parent 5400648 commit d5cd05e
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -150,7 +150,7 @@ public void onError(Session session, Throwable t) throws IOException {
* Again, since the asynchronous thread sends message in virtually no time,
* one does not have any force to hold that send operation in its thread, to
* check the send operation is really unblocking and asynchronous
*
*
* @param asyncRemote
* @return
*/
Expand Down Expand Up @@ -327,6 +327,11 @@ protected static String batchingAllowed(Basic basicRemote) {
// really there is nothing to test, except that the exception is
// not thrown
basicRemote.sendText(OPS.BATCHING_ALLOWED.name());
basicRemote.flushBatch();
// If batching is supported then it will currently be enabled.
// Reset it so subsequent messages are not batched causing the
// test to fail.
basicRemote.setBatchingAllowed(allowed);
return RESPONSE[0];
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit d5cd05e

Please sign in to comment.