db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-858) ijConnName test output order is non-deterministic.
Date Wed, 11 Nov 2009 17:25:39 GMT

    [ https://issues.apache.org/jira/browse/DERBY-858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776523#action_12776523
] 

Knut Anders Hatlen commented on DERBY-858:
------------------------------------------

The patch looks fine to me. A couple of tiny issues, though:

1) I noticed that SysinfoTest.searchMatchingString() uses
String.matches(String), which takes a regex argument. It looks to me
as if we're actually looking for exact match here, and not a regex
match, so it's probably better to use equals() instead.

2) The error message generated here can be wrong:

+            String ns = actualOutputArray[i];
+            assertTrue("Expected String: " + OUTPUT[i] + 
+                "doesn't match actual output: " + ns,
+                searchMatchingString(ns));
+

OUTPUT[i] is not necessarily the string that's supposed to match
actualOutputArray[i], given that the order is JVM dependent (which is
also why we use searchMatchingString() here and not just
ns.equals(OUTPUT[i])).

3) It looks like you forgot to remove one line of code that was
commented out:

+        String [] OUTPUT1 = {
+        //String OUTPUT1 = 
+            "--------- Derby Network Server Information --------" , 

4) A couple of instances in SysinfoTest where the closing braces have
been moved to an odd position:

-        assertEquals(OUTPUT, s);
-    }		
+        assertMatchingStringExists(s);    }		

> ijConnName test output order is non-deterministic.
> --------------------------------------------------
>
>                 Key: DERBY-858
>                 URL: https://issues.apache.org/jira/browse/DERBY-858
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>            Reporter: Daniel John Debrunner
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-858.diff
>
>
> The test loads four initial connections using these ij.connection properties in the test's
_app.properties file.
> ij.connection.connOne=jdbc:derby:wombat;create=true
> ij.connection.connTwo=jdbc:derby:lemming;create=true
> ij.connection.connThree=jdbc:noone:fruitfly;create=true
> ij.connection.connFour=jdbc:derby:nevercreated
> The order these connections are created, and hence the order of the test output is only
determined by the hash table ordering of the properties file. Making small changes in  ijConnName_app.properties
files can change the order, making the test appear to fail.
> E.g. I tried to enable the test with a security manager by modifying the noSecurityManger
to be set to false, and the order changed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message