You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2023/06/15 19:32:56 UTC

[jmeter] 02/02: test: add @Isolated to tests that extend JMeterTestCase

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit c0897715dc5d1ed7d02049062c3db8837a29cdb6
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Thu Jun 15 22:16:39 2023 +0300

    test: add @Isolated to tests that extend JMeterTestCase
    
    JMeterTestCase initializes jmeter properties, so the tests must not
    be executed concurrently.
---
 .../testFixtures/java/org/apache/jmeter/junit/JMeterTestCase.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/src/testFixtures/java/org/apache/jmeter/junit/JMeterTestCase.java b/src/core/src/testFixtures/java/org/apache/jmeter/junit/JMeterTestCase.java
index 1296969f75..ebf7adeb10 100644
--- a/src/core/src/testFixtures/java/org/apache/jmeter/junit/JMeterTestCase.java
+++ b/src/core/src/testFixtures/java/org/apache/jmeter/junit/JMeterTestCase.java
@@ -30,12 +30,16 @@ import org.apache.jmeter.engine.util.CompoundVariable;
 import org.apache.jmeter.functions.AbstractFunction;
 import org.apache.jmeter.functions.InvalidVariableException;
 import org.apache.jmeter.util.JMeterUtils;
+import org.junit.jupiter.api.parallel.Isolated;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /*
- * Common setup for JUnit4 test cases
+ * Common setup for JUnit4 test cases.
+ * It initializes JMeterProperties, so it is unsafe to execute several such tests concurrently, so it is marked with
+ * {@code @Isolated}.
  */
+@Isolated
 public abstract class JMeterTestCase {
     // Used by findTestFile
     private static final String filePrefix;