Skip to content

HDDS-16338. Fix no-op table size assertions in TestHSync - #11183

Open
shuan1026 wants to merge 2 commits into
apache:masterfrom
shuan1026:HDDS-16338
Open

HDDS-16338. Fix no-op table size assertions in TestHSync#11183
shuan1026 wants to merge 2 commits into
apache:masterfrom
shuan1026:HDDS-16338

Conversation

@shuan1026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

TestHSync had four no-op AssertJ calls of the form assertThat(n == collection.size()). assertThat(boolean) only builds an AbstractBooleanAssert, so those size checks never failed.

They live in two tests:

  • testHSyncOpenKeyCommitAfterExpiry: after expire, OpenKeyCleanupService should commit the hsynced open key and delete the non-hsync one. The size checks are about this test's key1/key2, not the whole tables.
  • testHSyncOpenKeyDeletionWhileDeleteDirectory: after hsync, openFileTable should have that one open key before the directory is deleted.

This class shares one static bucket and getOpenKeyInfo / getKeyInfo scan the entire layout. Turning the first test's checks into global assertEquals failed CI (expected: <1> but was: <4> on fileTable; round 1) because other tests leave committed keys behind. That is shared test state, not an hsync/cleanup product bug.

This PR:

  • replaces all four no-ops with assertEquals, matching the rest of the file
  • scopes the three expiry-test counts with filterByKeyName(..., key1, key2)

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16338

How was this patch tested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant