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

ASF GitHub Bot commented on TINKERPOP-1365:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/881

    TINKERPOP-1365 Refactored use of Random in tests

    Each test suite now uses the same instance of Random which prints the seed 
given to it so that if there is a failure, we can easily try to recreate it by 
taking the seed and passing it in as a system property with -DtestSeed. The 
output logs as:
    
    ```text
    [INFO] org.apache.tinkerpop.gremlin.TestHelper - *** THE RANDOM TEST SEED 
IS 1529585621517 ***
    ```
    
    I didn't replace all of the old use of `Random` - there were a couple 
places where I felt like a true `Random` was still necessary and just left it 
alone despite the horror it might cause. Going forward we'll want to use the 
`TestHelper.RANDOM` whenever possible (or, better, just not use a `Random` at 
all).
    
    All tests pass with `docker/build.sh -t -n -i`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1365

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/881.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #881
    
----
commit 12d9c793dda7b4cd98122756331916362055f389
Author: Stephen Mallette <spmva@...>
Date:   2018-06-21T14:11:58Z

    TINKERPOP-1365 Refactored use of Random in tests
    
    Each test suite now uses the same instance of Random which prints the seed 
given to it so that if there is a failure, we can easily try to recreate it by 
taking the seed and passing it in as a system property with -DtestSeed.

----


> Log the seed used to initialize Random in tests
> -----------------------------------------------
>
>                 Key: TINKERPOP-1365
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1365
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: test-suite
>    Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>            Reporter: Jason Plurad
>            Priority: Major
>
> {{HadoopGraphProvider}} and {{SparkHadoopGraphProvider}} use 
> {{RANDOM.nextBoolean()}} in an attempt to get coverage over different load 
> scenarios. In practice, this ends up causing nondeterministic execution of 
> the test suite, which can mask real errors lingering in the code or test code.
> See TINKERPOP-1360
> Logging the seed used for these tests will allow us to re-run the test in the 
> same way on failure.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to