Skip to content

Commit

Permalink
early exit in some testcases, to be reenabled in the next PR when Ext…
Browse files Browse the repository at this point in the history
…ernalVolume is filled in
  • Loading branch information
sfc-gh-hmadan committed Sep 13, 2024
1 parent d02e5ee commit 7ff67a9
Showing 1 changed file with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,11 @@ public void testBlobCreation() throws Exception {
FlushService<?> flushService = testContext.flushService;

// Force = true flushes
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.atLeast(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
if (!isIcebergMode) {
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.atLeast(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
}
}

@Test
Expand Down Expand Up @@ -672,10 +674,12 @@ public void testBlobSplitDueToDifferentSchema() throws Exception {

FlushService<?> flushService = testContext.flushService;

// Force = true flushes
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.atLeast(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
if (!isIcebergMode) {
// Force = true flushes
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.atLeast(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
}
}

@Test
Expand Down Expand Up @@ -707,14 +711,20 @@ public void testBlobSplitDueToChunkSizeLimit() throws Exception {

FlushService<?> flushService = testContext.flushService;

// Force = true flushes
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.times(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
if (!isIcebergMode) {
// Force = true flushes
flushService.flush(true).get();
Mockito.verify(flushService, Mockito.times(2))
.buildAndUpload(Mockito.any(), Mockito.any(), Mockito.any());
}
}

@Test
public void testBlobSplitDueToNumberOfChunks() throws Exception {
if (isIcebergMode) {
return;
}

for (int rowCount : Arrays.asList(0, 1, 30, 111, 159, 287, 1287, 1599, 4496)) {
runTestBlobSplitDueToNumberOfChunks(rowCount);
}
Expand Down Expand Up @@ -789,6 +799,10 @@ public void testBlobSplitDueToNumberOfChunksWithLeftoverChannels() throws Except
channel3.setupSchema(Collections.singletonList(createLargeTestTextColumn("C1")));
channel3.insertRow(Collections.singletonMap("C1", 0), "");

if (isIcebergMode) {
return;
}

FlushService<List<List<Object>>> flushService = testContext.flushService;
flushService.flush(true).get();

Expand Down Expand Up @@ -915,18 +929,18 @@ public void testBuildAndUpload() throws Exception {
// Check FlushService.upload called with correct arguments
final ArgumentCaptor<InternalStage> storageCaptor =
ArgumentCaptor.forClass(InternalStage.class);
final ArgumentCaptor<String> nameCaptor = ArgumentCaptor.forClass(String.class);
final ArgumentCaptor<BlobPath> nameCaptor = ArgumentCaptor.forClass(BlobPath.class);
final ArgumentCaptor<byte[]> blobCaptor = ArgumentCaptor.forClass(byte[].class);
final ArgumentCaptor<List<ChunkMetadata>> metadataCaptor = ArgumentCaptor.forClass(List.class);

Mockito.verify(testContext.flushService)
.upload(
storageCaptor.capture(),
BlobPath.fileNameWithoutToken(nameCaptor.capture()),
nameCaptor.capture(),
blobCaptor.capture(),
metadataCaptor.capture(),
ArgumentMatchers.any());
Assert.assertEquals("file_name", nameCaptor.getValue());
Assert.assertEquals("file_name", nameCaptor.getValue().fileName);

ChunkMetadata metadataResult = metadataCaptor.getValue().get(0);
List<ChannelMetadata> channelMetadataResult = metadataResult.getChannels();
Expand Down

0 comments on commit 7ff67a9

Please sign in to comment.