mosche commented on a change in pull request #15910:
URL: https://github.com/apache/beam/pull/15910#discussion_r743786543
##########
File path:
sdks/java/io/amazon-web-services/src/test/java/org/apache/beam/sdk/io/aws/sns/SnsIOTest.java
##########
@@ -123,20 +130,19 @@ public void testRetries() throws Throwable {
SnsIO.write()
.withTopicName(topicName)
.withRetryConfiguration(
- SnsIO.RetryConfiguration.create(4,
org.joda.time.Duration.standardSeconds(10)))
+ SnsIO.RetryConfiguration.create(4, standardSeconds(10),
millis(1)))
.withAWSClientsProvider(new Provider(amazonSnsErrors))
.withResultOutputTag(results));
try {
p.run();
} catch (final Pipeline.PipelineExecutionException e) {
// check 3 retries were initiated by inspecting the log before passing
on the exception
-
expectedLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
1));
-
expectedLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
2));
-
expectedLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
3));
+
snsWriterFnLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
1));
+
snsWriterFnLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
2));
+
snsWriterFnLogs.verifyWarn(String.format(SnsIO.Write.SnsWriterFn.RETRY_ATTEMPT_LOG,
3));
throw e.getCause();
}
- fail("Pipeline is expected to fail because we were unable to write to
SNS.");
Review comment:
The test already sets the expected exception using `thrown.expect*`,
which fails the test case if no exception is thrown.
```
@Rule public ExpectedException thrown = ExpectedException.none();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]