Skip to content

Commit

Permalink
Addressed comments: added metadata file counts for tests of TestHiveV…
Browse files Browse the repository at this point in the history
…iewCommits
  • Loading branch information
nk1506 committed Sep 13, 2024
1 parent b8c0446 commit dd82f4b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ public void testThriftExceptionSuccessOnCommit() throws TException, InterruptedE
assertThat(metadataFileExists(metadataV2))
.as("Current metadata file should still exist")
.isTrue();
assertThat(metadataFileCount(metadataV2))
.as("Commit should have been successful and new metadata file should be made")
.isEqualTo(2);
}

/**
Expand Down Expand Up @@ -235,6 +238,9 @@ public void testThriftExceptionUnknownFailedCommit() throws TException, Interrup
assertThat(metadataFileExists(metadataV2))
.as("Current metadata file should still exist")
.isTrue();
assertThat(metadataFileCount(metadataV2))
.as("Client could not determine outcome so new metadata file should also exist")
.isEqualTo(2);
}

/**
Expand Down Expand Up @@ -281,7 +287,6 @@ public void testThriftExceptionConcurrentCommit() throws TException, Interrupted

// This commit should fail and concurrent commit should succeed even though this commit
// throws an exception after the persist operation succeeds

assertThatThrownBy(() -> spyOps.commit(metadataV2, metadataV1))
.isInstanceOf(CommitStateUnknownException.class)
.hasMessageContaining("Datacenter on fire");
Expand Down Expand Up @@ -388,6 +393,7 @@ public void testLockExceptionUnknownSuccessCommit() throws TException, Interrupt
assertThat(metadataFileExists(metadataV2))
.as("Current metadata file should still exist")
.isTrue();
assertThat(metadataFileCount(metadataV2)).as("New metadata file should exist").isEqualTo(2);
}

@Test
Expand Down

0 comments on commit dd82f4b

Please sign in to comment.