You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/09/25 23:13:00 UTC

[jira] [Commented] (GEODE-3702) New framework for concurrency testing

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

ASF subversion and git services commented on GEODE-3702:
--------------------------------------------------------

Commit 13f3c396038fe5e2a8f7fe84d937969976f6dcac in geode's branch refs/heads/develop from [~upthewaterspout]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=13f3c39 ]

GEODE-3702 Adding a new framework for concurrency testing in geode

Added a new junit runner, ConcurrentTestRunner, for running a test that
has parallel threads.

The runner currently runs the test using Java PathFinder, which will
run the test with all interleavings of the threads.

Added an example test to geode-core for the FilterProfile serialization
logic.

There are options to configure which concurrent test runner to use, and
configuration for the JPF runner to pass jpf properties.


> New framework for concurrency testing
> -------------------------------------
>
>                 Key: GEODE-3702
>                 URL: https://issues.apache.org/jira/browse/GEODE-3702
>             Project: Geode
>          Issue Type: Improvement
>          Components: tests
>            Reporter: Dan Smith
>            Assignee: Dan Smith
>
> From the mailing list discussion:
> I'd like to propose two things:
> 1) We introduce a framework for writing unit tests of code that is
> supposed to be thread safe. This framework should let a developer
> easily write a test with multiple things going on in parallel. The
> framework can then take that code and try to run it with different
> thread interleavings.
> Here's an example of what this could look like:
> @RunWith(ConcurrentTestRunner.class)
> public class AtomicIntegerTest {
>   @Test
>   public void parallelIncrementReturns2(ParallelExecutor executor)
>       throws ExecutionException, InterruptedException {
>     AtomicInteger atomicInteger = new AtomicInteger();
>     executor.inParallel(() -> atomicInteger.incrementAndGet());
>     executor.inParallel(() -> atomicInteger.incrementAndGet());
>     executor.execute();
>     assertEquals(2, atomicInteger.get());
>   }
> 2) We implement this framework initially using Java Pathfinder, but
> allow for other methods of testing the code to be plugged in for
> example just running the test in the loop. Java pathfinder is cool
> because it can run the code with different interleavings but it does
> have some serious limitations.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)