You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@rya.apache.org by "Jonathan Wonders (JIRA)" <ji...@apache.org> on 2017/05/03 03:08:04 UTC

[jira] [Commented] (RYA-67) Improve the PCJ Integration test project's runtime when building.

    [ https://issues.apache.org/jira/browse/RYA-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994206#comment-15994206 ] 

Jonathan Wonders commented on RYA-67:
-------------------------------------

There are a few approaches that can be taken for sharing a mini accumulo cluster (and mini fluo, etc).

1. Use a maven plugin to manage the lifecycle of a shared mini accumulo instance.
2. Enclose tests that need the mini accumulo instance in a test suite and let the test suite govern the lifecycle of the shared mini accumulo instance.
3. Create a lazily-initialized singleton and register a shutdown hook.

I prefer the lazy-initialized singleton approach.  Using a maven plugin makes it inconvenient to run individual tests, especially from within an IDE.  The test suite approach has a similar disadvantage that in order to execute individual tests from within an IDE, the test class must also be able to manage the mini accumulo instance (but only if running outside of the suite).  The singleton approach works well for executing tests within or outside of an IDE and within or outside test suites.

It is also possible to defer the decision to runtime by introducing a service loading layer and choosing an implementation with system properties or something similar.  This is a bit more work, but it can enable running integration tests against a "real" accumulo instance.

There are a few things to watch out for when sharing a mini accumulo instance.  Some of these might not apply to Rya right now, but they might in the future.

1. Tests that refer to the same tables / rya instance
2. Cache/Reference invalidation (does test cleanup leave data in a cache)
3. User State (existence, permissions, authorizations)
4. Persistent Accumulo Configuration

Tests should be kept as independent as possible.  However, recreating tables and rewriting the same data for multiple tests can have a big impact on test runtime as well.

I would also recommend splitting out the integration tests that require mini accumulo from the unit tests and use the failsafe plugin to execute the integration tests during builds.  That is probably outside the scope of this issue though.

> Improve the PCJ Integration test project's runtime when building.
> -----------------------------------------------------------------
>
>                 Key: RYA-67
>                 URL: https://issues.apache.org/jira/browse/RYA-67
>             Project: Rya
>          Issue Type: Improvement
>            Reporter: Kevin Chilton
>            Priority: Minor
>
> The Fluo PCJ Integration Tests project takes a long time to run because it starts up and shuts down a mini accumulo cluster as well as a mini fluo instance between every test. 
> This could be improved by reusing the mini resources between tests.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)