HDDS-16131. Intermittent failure in TestBlockDeletingService#testBlockDeletionMetricsUpdatedProperlyAfterEachExecution - #11013
HDDS-16131. Intermittent failure in TestBlockDeletingService#testBlockDeletionMetricsUpdatedProperlyAfterEachExecution#11013echonesis wants to merge 2 commits into
Conversation
…kDeletionMetricsUpdatedProperlyAfterEachExecution
|
Overall it looks good. One small thing. It would be better to move service shutdown in @AfterEach. That would prevent this problem in future tests (if someone miss the shutdown) |
Thanks for the suggestion. |
| private String schemaVersion; | ||
| private int blockLimitPerInterval; | ||
| private MutableVolumeSet volumeSet; | ||
| private BlockDeletingService blockDeletingService; |
There was a problem hiding this comment.
nit: reset this to null in init(). It is never cleared, so a test that runs after a service-creating one without creating its own will re-shutdown() the prior (already-terminated) instance in cleanup. Harmless since shutdown() is idempotent, but resetting drops the cross-test coupling.
|
@echonesis thanks for the patch! |
What changes were proposed in this pull request?
This patch ensures that
BlockDeletingServiceTestImplis shut down in a finally block. Service shutdown waits for the deletion tasks to finish and release their container DB references before test cleanup runs.The same lifecycle handling is also added to
testChecksumFileUpdatedWhenDeleteRetried, which starts the service without shutting it down and is susceptible to the same teardown race.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16131
How was this patch tested?
Local Test
GitHub Actions CI