Skip to content

Fix flaky StampedWriterPreferredLock test - #17832

Merged
JackieTien97 merged 1 commit into
masterfrom
fix-stamped-lock-test-timeout
Jun 3, 2026
Merged

Fix flaky StampedWriterPreferredLock test#17832
JackieTien97 merged 1 commit into
masterfrom
fix-stamped-lock-test-timeout

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

What

  • Make testAcquireReadLockWhileWriting wait until the reader is actually blocked by the held write lock before releasing it.
  • Wait for the reader thread to finish with a latch and release the write lock in failure paths.

Testing

  • mvn -pl iotdb-core/datanode spotless:apply
  • javac --release 8 ... StampedWriterPreferredLock.java StampedWriterPreferredLockTest.java && java ... org.junit.runner.JUnitCore org.apache.iotdb.db.metadata.mtree.lock.StampedWriterPreferredLockTest

The full Maven datanode test command is currently blocked locally by unrelated datanode generated-source/test compilation errors.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecovBot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.91%. Comparing base (a420681) to head (5363380).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #17832 +/- ##
============================================
+ Coverage 40.87% 40.91% +0.04% 
Complexity 2611 2611 ============================================
Files 5186 5187 +1 Lines 351308 351561 +253 Branches 44971 45008 +37 ============================================
+ Hits 143585 143854 +269 + Misses 207723 207707 -16 

☔ View full report in Codecov by Sentry.
📢 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.

@JackieTien97
JackieTien97 merged commit 2fd70b9 into masterJun 3, 2026
43 of 47 checks passed
@JackieTien97
JackieTien97 deleted the fix-stamped-lock-test-timeout branch June 3, 2026 09:32
Caideyipi added a commit that referenced this pull request Jun 5, 2026
MileaRobertStefan pushed a commit to MileaRobertStefan/iotdb that referenced this pull request Jun 26, 2026
Sign up for freeto 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.

2 participants

@Caideyipi@JackieTien97