Skip to content

Align 1.3 ordinary-flush tests with production behavior - #19529

Draft
Caideyipi wants to merge 3 commits into
dev/1.3from
codex/remove-ordinary-flush-tests-dev13
Draft

Caideyipi wants to merge 3 commits into
dev/1.3from
codex/remove-ordinary-flush-tests-dev13

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The 1.3 DataNode test job remained active for six hours after the multi-flush test had already been removed. The remaining ordinary-flush tests call TsFileProcessor.asyncFlush() directly, but this method has no production call sites in dev/1.3. Several close tests also use the @TestOnly syncClose() path instead of the production full-flush close path. The Pipe realtime fixture could write an empty TsFile and retain progress-index state across test methods.

This PR aligns tests with production behavior:

  • Remove the two DataRegionTest cases that directly exercise asyncFlush().
  • Use asyncCloseForFullFlush() and wait/retry until full flush marks the processor closing in TsFileProcessorTest.
  • Exercise the production full-flush wait barrier in DataRegionTest.
  • Write a valid row in Pipe test TsFiles and reset the test pipe's saved progress index before each test.

Before: tests exercise an uncalled ordinary-flush path or test-only close API; Pipe assertions can see empty files or stale progress state.
After: tests cover the production full-flush path with valid, isolated Pipe fixtures. No production code changes.

Validation

  • mvn spotless:apply -pl iotdb-core/datanode -am — passed.
  • mvn clean test -pl iotdb-core/datanode -am -Dtest=PipeRealtimeExtractTest,DataRegionTest,TsFileProcessorTest -Dsurefire.failIfNoSpecifiedTests=false — passed (81 tests: 80 passed, 1 skipped; 0 failures/errors).

@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Validation update for bad7f131d46a90d8eca995a685d5d3394dc4bc2b:

  • This PR removes the two remaining test call sites of TsFileProcessor.asyncFlush(); the 1.3 production sources have no call sites for that method.
  • The Actions job still cancels after starting TsFileProcessorTest. Its log shows three setup cycles and no class completion. JUnit 4.13.2 default method ordering makes testWriteAndRestoreMetadata the third test and the leading candidate, but the job log does not expose a method-level stack, so this is not confirmed.
  • That candidate calls test-only syncFlush(), not the ordinary async entry point. It does enqueue through addAMemtableIntoFlushingList() and the same flush worker used by production close-triggered flushing. I have not removed it because doing so could hide a core flush issue.
  • A focused remote test attempt did not reach test execution: Maven could not resolve org.apache.tsfile:tsfile:1.1.5-SNAPSHOT because JitPack returned HTTP 403.

No additional code change or commit was made in this update. Local HEAD and the confirmed PR branch head are both bad7f131d46a90d8eca995a685d5d3394dc4bc2b; the PR remains open.

@Caideyipi
Caideyipi marked this pull request as draft December 4, 2026 04:09
@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Review summary (reviewed commit bad7f131d46a90d8eca995a685d5d3394dc4bc2b; final local and PR head 3a282114c8fd906d89d9647ba49a8333ea54f8e6)

  • Finding: testWriteAndRestoreMetadata ended with test-only syncClose() polling for writer shutdown, which could wait indefinitely after its flush future completed.
  • Fix: Keep the metadata-restore assertions and close through asyncCloseForFullFlush(), waiting for FlushManager release and retrying until the processor is marked closing; assert that the TsFile resource is closed. No production code changes.
  • Verification: mvn clean test -P with-integration-tests -pl iotdb-core/datanode -am -Dtest=TsFileProcessorTest#testWriteAndRestoreMetadata -Dsurefire.failIfNoSpecifiedTests=false passed (1 test); spotless:apply passed. Pushed to the PR source branch. The PR remains draft pending independent review.

@Caideyipi Caideyipi changed the title Remove ordinary async flush tests from DataRegionTest Align 1.3 ordinary-flush tests with production behavior Dec 4, 2026
@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Review round summary

  • Reviewed starting head: 3a282114c8fd906d89d9647ba49a8333ea54f8e6.
  • Findings: tests exercised an ordinary asyncFlush() path with no production call sites and the @TestOnly syncClose() helper; Pipe fixtures could be empty or inherit progress-index state.
  • Fixes: align close tests with the production full-flush path and make Pipe fixtures valid and isolated. No production code changes.
  • Verification: Spotless passed; 81 tests ran (80 passed, 1 skipped, 0 failures/errors).
  • Final local and confirmed remote head: 63dbac23d4b5cd2a31fddb84fdc5e3e94c93d27a. The PR remains draft pending a fresh independent review.

@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.48%. Comparing base (61f7d55) to head (63dbac2).
⚠️ Report is 3 commits behind head on dev/1.3.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev/1.3   #19529      +/-   ##
=============================================
+ Coverage      48.25%   48.48%   +0.23%     
  Complexity       223      223              
=============================================
  Files           3688     3691       +3     
  Lines         254110   255466    +1356     
  Branches       31696    31988     +292     
=============================================
+ Hits          122631   123873    +1242     
- Misses        131479   131593     +114     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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