From a6e919584db32a2efdfe4ca1773525f31ebf91bf Mon Sep 17 00:00:00 2001 From: Remco Bouckaert Date: Wed, 12 Jun 2024 13:52:25 +1200 Subject: [PATCH] update some tests that rely on Randomizer #1141 --- .../evolution/operator/BactrianRandomWalkOperatorTest.java | 2 ++ .../beast/evolution/operator/BactrianScaleOperatorTest.java | 1 + .../evolution/operator/BactrianUpDownOperatorTest.java | 1 + .../beast/evolution/operator/KernelDistiburionTest.java | 6 +++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test/beast/evolution/operator/BactrianRandomWalkOperatorTest.java b/test/test/beast/evolution/operator/BactrianRandomWalkOperatorTest.java index 3b746c56..a11d4b4c 100644 --- a/test/test/beast/evolution/operator/BactrianRandomWalkOperatorTest.java +++ b/test/test/beast/evolution/operator/BactrianRandomWalkOperatorTest.java @@ -35,6 +35,7 @@ public void testNormalDistribution() throws Exception { // Fix seed: will hopefully ensure success of test unless something // goes terribly wrong. + Thread.currentThread().setName("testNormalDistribution"); Randomizer.setSeed(127); // Assemble model: @@ -108,6 +109,7 @@ public void testLogNormalDistribution() throws Exception { // Fix seed: will hopefully ensure success of test unless something // goes terribly wrong. + Thread.currentThread().setName("testLogNormalDistribution"); Randomizer.setSeed(131); // Assemble model: diff --git a/test/test/beast/evolution/operator/BactrianScaleOperatorTest.java b/test/test/beast/evolution/operator/BactrianScaleOperatorTest.java index 318c9ecf..a5d7fb53 100644 --- a/test/test/beast/evolution/operator/BactrianScaleOperatorTest.java +++ b/test/test/beast/evolution/operator/BactrianScaleOperatorTest.java @@ -157,6 +157,7 @@ void doMCMCrun(RealParameter param, Operator bactrianOperator) throws IOExceptio void doMCMCrun(RealParameter param, Operator bactrianOperator, Operator optionOperator) throws IOException, SAXException, ParserConfigurationException { // Fix seed: will hopefully ensure success of test unless something // goes terribly wrong. + Thread.currentThread().setName("doMCMCrun"); Randomizer.setSeed(127); param.setBounds(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY); diff --git a/test/test/beast/evolution/operator/BactrianUpDownOperatorTest.java b/test/test/beast/evolution/operator/BactrianUpDownOperatorTest.java index 9a399eed..e59dc8db 100644 --- a/test/test/beast/evolution/operator/BactrianUpDownOperatorTest.java +++ b/test/test/beast/evolution/operator/BactrianUpDownOperatorTest.java @@ -76,6 +76,7 @@ public void testLogNormalDistribution() throws Exception { void doMCMCrun(Function param, List operators) throws IOException, SAXException, ParserConfigurationException { // Fix seed: will hopefully ensure success of test unless something // goes terribly wrong. + Thread.currentThread().setName("doMCMCrun"); Randomizer.setSeed(127); diff --git a/test/test/beast/evolution/operator/KernelDistiburionTest.java b/test/test/beast/evolution/operator/KernelDistiburionTest.java index 58f8cd86..ee51401f 100644 --- a/test/test/beast/evolution/operator/KernelDistiburionTest.java +++ b/test/test/beast/evolution/operator/KernelDistiburionTest.java @@ -12,6 +12,7 @@ public class KernelDistiburionTest { @Test public void testBactrianKernelDistribution() { + Thread.currentThread().setName("testBactrianKernelDistribution"); Randomizer.setSeed(127); // testMeanIsZeroSigmaIsOne(new KernelDistribution.Bactrian(mode.cauchy)); @@ -75,7 +76,8 @@ private void testMeanIsZeroSigmaIsOne(KernelDistribution.Bactrian distr, boolean @Test public void testMirrorfKernelDistribution() { Log.warning("Testing mirror distribution"); - Randomizer.setSeed(125); + Thread.currentThread().setName("testBactrianKernelDistribution"); + Randomizer.setSeed(124); KernelDistribution.Mirror distr = new KernelDistribution.Mirror(mode.bactrian_normal); @@ -104,6 +106,7 @@ public void testMirrorfKernelDistribution() { @Test public void testMultiDimensionalMirrorfKernelDistribution() { Log.warning("Testing mirror distribution"); + Thread.currentThread().setName("testMultiDimensionalMirrorfKernelDistribution"); Randomizer.setSeed(123); KernelDistribution.Mirror distr = new KernelDistribution.Mirror(); @@ -140,6 +143,7 @@ public void testMultiDimensionalMirrorfKernelDistribution() { @Test public void testMultiDimensionalMirrorfKernelDistributionScaler() { Log.warning("Testing mirror distribution for scaling"); + Thread.currentThread().setName("testMultiDimensionalMirrorfKernelDistributionScaler"); Randomizer.setSeed(123); KernelDistribution.Mirror distr = new KernelDistribution.Mirror();