You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (JIRA)" <ji...@apache.org> on 2014/07/03 01:10:27 UTC

[jira] [Updated] (DERBY-6590) Make JUnit tests run the fixtures in a deterministic order.

     [ https://issues.apache.org/jira/browse/DERBY-6590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-6590:
---------------------------------

    Attachment: derby-6590-1.diff

Attaching a patch for this issue: [^derby-6590-1.diff]. From its local Git commit message:

A new test suite class is introduced to replace the standard JUnit TestSuite: DerbyTestSuite. From its Javadoc:

{code}
/**
 * Derby replacement for TestSuite. This version, when provided with a
 * {@code Class} argument in a constructor or method, wraps a {@code TestSuite}
 * around a lexicographically sorted set of fixtures to avoid random fixture
 * ordering after Java 6. It is a somewhat leaky abstraction: a call to
 * {@code tests()} will return the wrapped {@code TestSuite} instead of
 * the tests of the provided class argument}. So in order to locate the
 * tests, a client of this class must step one further step down, i.e. ask for
 * the tests of that wrapped {@code TestSuite}. Except for this, its usage
 * should be straight forward, similar to the original TestSuite.
 */
{code}
For an example of the changed semantics in "tests()", cf the change to StatementEventsTest in this patch.

If we decide to commit this patch, new JUnit tests should all use the new test suite class in order to retain the deterministic ordering of the regression tests. I have verified that all tests are still performed (manually: in my environment I see 19023 tests in suites.All and 122 in the harness derbyall - with Java 8). 


> Make JUnit tests run the fixtures in a deterministic order.
> -----------------------------------------------------------
>
>                 Key: DERBY-6590
>                 URL: https://issues.apache.org/jira/browse/DERBY-6590
>             Project: Derby
>          Issue Type: Improvement
>            Reporter: Dag H. Wanvik
>         Attachments: derby-6590-1.diff
>
>
> Since JDK 7, when we use the standard decorator for JUnit tests, e.g.
> return TestConfiguration.defaultSuite(AggBuiltinTest.class);
> the order in which the test fixtures get run is indeterministic. This is undesirable because it doesn't add much coverage to the product and makes the tests more brittle than they need to be.
> We should use TestConfiguration#orderedSuite instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)