[ https://issues.apache.org/jira/browse/PHOENIX-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15094462#comment-15094462 ]
Samarth Jain commented on PHOENIX-2368: --------------------------------------- I figured out the issue. [~ram_krish] - The test that you wrote in PhoenixDriverTest#testInvalidUrl() is causing this flappy behavior. Please be more careful before doing drastic things like closing the main PhoenixDriver in test methods. You don't really need to close the driver at first place for your test. {code} @Test public void testInvalidURL() throws Exception { Class.forName(PhoenixDriver.class.getName()); PhoenixDriver d = (PhoenixDriver) DriverManager.getDriver("jdbc:phoenix"); d.close(); //// DON'T DO THIS! try { DriverManager.getConnection("any text whatever you want to put here"); fail("Should have failed due to invalid driver"); } catch(Exception e) { } } {code} I will commit this. > Call Driver.accept() in Driver.getConnection and return null if false > --------------------------------------------------------------------- > > Key: PHOENIX-2368 > URL: https://issues.apache.org/jira/browse/PHOENIX-2368 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Assignee: ramkrishna.s.vasudevan > Labels: SFDC, newbie > Fix For: 4.7.0 > > Attachments: PHOENIX-2368.patch, PHOENIX-2368.patch, > PHOENIX-2368_1.patch > > > The driver should return "null" if it realizes it is the wrong kind of driver > to connect to the given URL. > Your driver is throwing an exception instead of returning null. > Here's the start of a test case: > {code} > public static void main(String[] args) throws Exception { > Class.forName(PhoenixDriver.class.getName()); > PhoenixDriver d = (PhoenixDriver) DriverManager.getDriver("jdbc:phoenix"); > d.close(); > DriverManager.getConnection("any text whatever you want to put here"); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)