haridsv opened a new pull request, #8116:
URL: https://github.com/apache/hbase/pull/8116

   Ran for 20 times in a loop to verify.
   
   AI tool: Claude Code
   AI Model: Sonnet 4.5 (reverified using Opus 4.6 (1M context))
   Prompt: You need to diagnose the HBase test TestZooKeeper that is flapping. 
It had multiple failures and errors in the PR validation build, but none when I 
ran locally. The source code is at @../../src/apache/hbase/ and the logs for 
good run is at @good-run and bad run is at @bad-run. Can you compare the logs 
and try to understand why the run failed and look at the code for a potential 
fix?
   
   Here is the AI summary for the fix:
   
   **Problem Identified:**
   - Line 78 had a duplicate call to `TEST_UTIL.startMiniDFSCluster(2)`
   - This violated the "can only create one" constraint and caused HDFS 
namespace conflicts when tests ran in parallel
   
   **Why it was flaky:**
   - ✅ **Local/isolated runs**: Worked because no leftover HDFS state
   - ❌ **CI/parallel runs**: Failed when other ZooKeeper tests ran first, 
leaving behind HDFS data with incompatible `namespaceID`
   
   **Fix Applied:**
   Removed the duplicate call on line 78. The test now properly:
   1. Starts Mini DFS Cluster (line 71)
   2. Starts Mini ZK Cluster (line 72)
   3. Configures settings (lines 73-77)
   4. Done! (no duplicate cluster start)
   
   This matches the pattern used in other similar tests like 
`TestClusterBootOrder` and aligns with the comment's intent: "Test we can first 
start the ZK cluster by itself."
   
   The test should now be stable across both local and CI environments. You can 
verify by running the test suite again to ensure `TestZooKeeper` no longer 
fails with `InconsistentFSStateException`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to