While analyzing HDFS-17951, I found that many tests leak mini-cluster
instances (MiniDFSCluster, MiniQJMHACluster, MiniJournalCluster,
MiniRouterDFSCluster, MiniYARNCluster, MiniMRYarnCluster and variants).

A static scan of the test sources — vetted by hand to remove false
positives such as clusters owned by harnesses or torn down through wrapper
objects — found 86 cases in ~60 files, in three categories:
  A) 27 tests create a local cluster and never shut it down on any path.

  B) 38 tests shut the cluster down only on the happy path (no finally /
 try-with-resources), so the cluster leaks exactly when the test fails.

  C) 21 classes hold a cluster in a field with no teardown in the class
or its superclasses.

Impact: leaks stay within the class, but a leaked cluster keeps CI
resources under the remaining tests, and one failure can cascade into bogus
failures of later tests in the class.There is no impact on production, only
improvement for CI testing.

Please open a JIRA for this, and I will be happy to contribute.

Regards,
Jose Luis López

Reply via email to