if (receiveMessageResult.getMessages().size() == 1) {
assertTrue("wrong message content", receiveMessageResult.getMessages().get(0).getBody().equals(message));
long durationSec = (System.currentTimeMillis() - start)/1000;
logger.info("message found again after " + durationSec + " sec");
DeleteMessageRequest deleteMessageRequest = new DeleteMessageRequest();
deleteMessageRequest.setQueueUrl(queueUrl);
deleteMessageRequest.setReceiptHandle(receiveMessageResult.getMessages().get(0).getReceiptHandle());
cqs1.deleteMessage(deleteMessageRequest);
logger.info("deleted message");
assertTrue("message became visible already after " + durationSec + " sec", durationSec >= expectedDelaySeconds);
break;
}