mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
test(dynamodb): stabilize the incremental export SDK fixture (#6516)
This commit is contained in:
1 parent
29eae434f6
commit
00e6b0d905
1 file changed
+8
-2
+8
-2
@@ -13,6 +13,7 @@ import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
@@ -284,15 +285,20 @@ class DynamoDbExportTest {
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
void exportTableToPointInTime_incrementalUnder15Minutes_throwsInvalidExportTimeException() {
|
||||
void exportTableToPointInTime_incrementalUnder15Minutes_throwsInvalidExportTimeException() throws InterruptedException {
|
||||
Instant created = ddb.describeTable(r -> r.tableName(TABLE_NAME)).table().creationDateTime();
|
||||
Instant from = created.truncatedTo(ChronoUnit.SECONDS);
|
||||
Instant to = from.plusSeconds(1);
|
||||
TestFixtures.await(() -> Instant.now().isAfter(to), TABLE_NAME, "one-second export period elapsed",
|
||||
Duration.ofSeconds(5).toNanos(), 25);
|
||||
|
||||
assertThatThrownBy(() -> ddb.exportTableToPointInTime(ExportTableToPointInTimeRequest.builder()
|
||||
.tableArn(tableArn)
|
||||
.s3Bucket(BUCKET_NAME)
|
||||
.exportType(ExportType.INCREMENTAL_EXPORT)
|
||||
.incrementalExportSpecification(IncrementalExportSpecification.builder()
|
||||
.exportFromTime(created.truncatedTo(ChronoUnit.SECONDS))
|
||||
.exportFromTime(from)
|
||||
.exportToTime(to)
|
||||
.exportViewType(ExportViewType.NEW_IMAGE)
|
||||
.build())
|
||||
.build()))
|
||||
|
||||
Reference in new issue
Block a user