[
https://issues.apache.org/jira/browse/BEAM-13192?focusedWorklogId=677074&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-677074
]
ASF GitHub Bot logged work on BEAM-13192:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Nov/21 15:59
Start Date: 05/Nov/21 15:59
Worklog Time Spent: 10m
Work Description: 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`, 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]
Issue Time Tracking
-------------------
Worklog Id: (was: 677074)
Time Spent: 50m (was: 40m)
> Tests for retries in SnsIO.Writer are buggy
> -------------------------------------------
>
> Key: BEAM-13192
> URL: https://issues.apache.org/jira/browse/BEAM-13192
> Project: Beam
> Issue Type: Bug
> Components: io-java-aws
> Reporter: Moritz Mack
> Assignee: Moritz Mack
> Priority: P3
> Time Spent: 50m
> Remaining Estimate: 0h
>
> There's no working verification that retries happened.
> All assertions fail in unforeseen / unintended ways.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)