From 2fe8982cf6e313b0e28d1a08bd9fe9f8a74824f8 Mon Sep 17 00:00:00 2001 From: "Li, George (gl741q)" Date: Thu, 7 Mar 2024 10:51:08 -0600 Subject: [PATCH] fix: isNonGUI doesn't work for distributed tests --- .../java/com/di/jmeter/config/ExtendedCsvDataSetConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/di/jmeter/config/ExtendedCsvDataSetConfig.java b/src/main/java/com/di/jmeter/config/ExtendedCsvDataSetConfig.java index eeff5b9..52afcc0 100644 --- a/src/main/java/com/di/jmeter/config/ExtendedCsvDataSetConfig.java +++ b/src/main/java/com/di/jmeter/config/ExtendedCsvDataSetConfig.java @@ -200,10 +200,14 @@ private void setAlias(final JMeterContext context, String alias) { } } + private boolean isServerMode() { + return System.getProperty("server_port") != null; + } + @Override public void testStarted() { FileServerExtended fileServer = FileServerExtended.getFileServer(); - if(JMeter.isNonGUI()){ + if(JMeter.isNonGUI() || isServerMode()){ String baseDirectory = org.apache.jmeter.services.FileServer.getFileServer().getBaseDir(); fileServer.setBasedir(baseDirectory); }else {