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

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

Github user dkuppitz commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/881#discussion_r197826190
  
    --- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/TestHelper.java ---
    @@ -51,11 +52,19 @@
      * @author Stephen Mallette (http://stephen.genoprime.com)
      */
     public final class TestHelper {
    +    private static final Logger logger = 
LoggerFactory.getLogger(TestHelper.class);
     
    +    public static final Random RANDOM;
         private static final String SEP = File.separator;
         private static final char URL_SEP = '/';
         public static final String TEST_DATA_RELATIVE_DIR = "test-case-data";
     
    +    static {
    +        final long seed = Long.parseLong(System.getProperty("testSeed", 
String.valueOf(System.currentTimeMillis())));
    +        logger.info("*** THE RANDOM TEST SEED IS {} ***", seed);
    +        RANDOM = new Random();
    --- End diff --
    
    This should be `RANDOM = new Random(seed);`.


> 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