Skip to content

[Test] Avoid metadata lease fencing in DataNode unit tests#18284

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/metadata-lease-unit-test-timeout
Open

[Test] Avoid metadata lease fencing in DataNode unit tests#18284
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/metadata-lease-unit-test-timeout

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

DataNode unit-test JVMs do not receive ConfigNode heartbeats. When a cache-related test class runs for more than the 20-second metadata lease threshold, the singleton MetadataLeaseManager fences the local caches and causes unrelated test failures such as TreeViewTest.

Configure the DataNode unit-test environment to disable the background metadata lease check. This only changes src/test/resources; production and integration-test configurations are unaffected. The metadata lease tests keep their coverage because they use independently constructed managers with injected clocks.

Setting the test-wide check interval avoids duplicating lease recovery setup across every cache test and also protects future unit tests that use the same guarded singletons.

Verification

  • git diff --check
  • DataNode unit tests on Ubuntu: passed
  • DataNode unit tests on Windows: passed

This PR has:

  • been self-reviewed.
  • added a comment explaining why metadata lease checking is disabled for unit tests.
  • updated the shared unit-test configuration to cover existing cache tests.
Key changed/added classes (or packages if there are too many classes) in this PR
  • iotdb-core/datanode/src/test/resources/iotdb-system.properties

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