Skip to content

Conversation

@sarvekshayr
Copy link
Contributor

What changes were proposed in this pull request?

The FailureType enum is used to indicate what type of issue the scanner saw. TestContainerCorruptions also provides an enum for injecting different types of failures into tests. The two are separate since some FailureTypes may be hit with multiple paths, each identified by a unique entry in TestContainerCorruptions

As suggested in this comment, introduced a test to trigger a test failure if a new FailureType is added (expanding the functionality of the scanner) but no corresponding test is added. This may mean making the two enums more tightly coupled.

What is the link to the Apache JIRA

HDDS-11756

How was this patch tested?

Added TestFailureTypeCoverage.

Test fails if a FailureType does not have a corresponding test or is not explicitly excluded.

org.opentest4j.AssertionFailedError: The following FailureType values do not have corresponding test 
corruptions in TestContainerCorruptions: [WRITE_FAILURE]. Either add test cases for these failure types 
or exclude them with an explanation (via getExcludedFailureTypes()). ==> 


/**
* Set of {@link ContainerScanError.FailureType} values that are excluded from testing.
* When adding a FailureType to this set, add a comment explaining why it's excluded.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@errose28 The below FailureType constants currently don’t have corresponding test coverage. Do we have any specific reason or context for their exclusion so I can document it here?

@sarvekshayr sarvekshayr marked this pull request as ready for review November 14, 2025 08:59
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