Skip to content
Permalink
Browse files
8243432: use reproducible random in :vmTestbase_vm_defmeth
Reviewed-by: dholmes
  • Loading branch information
iignatev committed May 5, 2020
1 parent 0b7a476 commit 2163dec6c423616663d40812657ce9b72fa8eff5
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
import vm.share.options.Option;
import vm.share.options.OptionSupport;
import vm.share.options.Options;
import jdk.test.lib.Utils;
import static jdk.internal.org.objectweb.asm.Opcodes.*;

/*
@@ -72,7 +73,7 @@
private Throwable reason;
private volatile long executedTests = 0;

public Worker(String id, int seed) {
public Worker(String id, long seed) {
setName(id);
this.rand = new Random(seed);
}
@@ -215,7 +216,7 @@ private void configureTests() {
private void startWorkers() {
Random rand;
if (seed == 0) {
seed = (new Random()).nextInt();
seed = Utils.SEED;
}

System.out.printf("Seed: %d\n", seed);
@@ -247,7 +248,7 @@ private void startWorkers() {
for (int i = 0; i < workers.length; i++) {
workers[i] = new Worker(
String.format("Worker #%d/%d", i+1, workers.length),
rand.nextInt());
rand.nextLong());
}

for (Worker worker : workers) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@

/*
* @test
* @key randomness
* @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open
*
* @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Stress_noredefine.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@

/*
* @test
* @key randomness
* @modules java.base/jdk.internal.org.objectweb.asm:+open java.base/jdk.internal.org.objectweb.asm.util:+open
*
* @summary converted from VM Testbase vm/runtime/defmeth/scenarios/Stress_redefine.

0 comments on commit 2163dec

Please sign in to comment.