Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-7964: Wait for Phoenix system tables to initialize before sta… - #14
Conversation
…rting REST server Before starting the REST server in integration tests, ensure Phoenix system tables are fully initialized by calling TestUtils.awaitPhoenixReady(). This eliminates the race condition that caused intermittent test failures with: org.apache.phoenix.exception.PhoenixIOException: SYSTEM.CATALOG Caused by: org.apache.hadoop.hbase.TableNotFoundException: SYSTEM.CATALOG The fix adds TestUtils.awaitPhoenixReady(url) calls to all 82 integration test classes, either directly in their @BeforeClass methods or through inheritance from base classes like BaseSegmentScanIT, KclTestBase, UpdateItemBaseTests, and SegmentScanIT. The awaitPhoenixReady() method polls for up to 30 seconds (vs RESTServer's 5 seconds) for Phoenix to become ready, providing sufficient time for SYSTEM.CATALOG initialization even on slow CI workers. Changes: - Added TestUtils.awaitPhoenixReady() calls to 58 integration test classes - Fixed DeleteTableIT to construct Phoenix JDBC URL before REST server initialization - 24 additional test classes inherit the fix through base class inheritance - Total coverage: 82/82 integration test classes
| restServer = new RESTServer(utility.getConfiguration()); | ||
| restServer.run(); | ||
| String url = "http://" + restServer.getServerAddress(); |
There was a problem hiding this comment.
We need to build a JDBC URL from the ZK quorum here, not the rest server url.
| TestUtils.awaitPhoenixReady(url); | ||
There was a problem hiding this comment.
We have 2 options:
- remove
awaitPhoenixReady()from this test - remove this test entirely
I prefer option 1, which means this single IT test will not be protected by awaitPhoenixReady() and can lead to flaky test failure, which is okay.
| utility = new HBaseTestingUtility(conf); | ||
| setUpConfigForMiniCluster(conf); | ||
| utility.startMiniCluster(); | ||
| String zkQuorum = "127.0.0.1:" + utility.getZkCluster().getClientPort(); |
There was a problem hiding this comment.
Why we have 127.0.0.1 here instead of localhost (everywhere else)?
virajjasani
left a comment
There was a problem hiding this comment.
One thing to consider before we are good to go
| setUpConfigForMiniCluster(conf); | ||
| utility.startMiniCluster(); | ||
| String zkQuorum = "127.0.0.1:" + utility.getZkCluster().getClientPort(); | ||
| String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); |
There was a problem hiding this comment.
Here we should let it be 127.0.0.1 otherwise we have test failure in the latest build?
There was a problem hiding this comment.
Basically no change needed in this IT test :)
Uh oh!
There was an error while loading. Please reload this page.
…rting REST server
Before starting the REST server in integration tests, ensure Phoenix system tables
are fully initialized by calling TestUtils.awaitPhoenixReady().
This eliminates the race condition that caused intermittent test failures with:
org.apache.phoenix.exception.PhoenixIOException: SYSTEM.CATALOG
Caused by: org.apache.hadoop.hbase.TableNotFoundException: SYSTEM.CATALOG
The fix adds TestUtils.awaitPhoenixReady(url) calls to all 82 integration test classes, either directly in their @BeforeClass methods or through inheritance from base classes like BaseSegmentScanIT, KclTestBase, UpdateItemBaseTests, and SegmentScanIT.
The awaitPhoenixReady() method polls for up to 30 seconds (vs RESTServer's 5 seconds) for Phoenix to become ready, providing sufficient time for SYSTEM.CATALOG initialization even on slow CI workers.
Changes: