Search code examples
propertiesjmetersubstitutionbeanshell

some Jmeter property substitution (${__P(...)}) not working in remote test


UPDATE: I attached the test script. The two substitutions not being honored are at CSV-DATASOURCE (the filename) and in the main thread group (number of threads): test plan file

This is starting to drive us crazy. Using Jmeter 3.3 r1808647. Property substitution seems to completely fail, but only when the test is ran remotely.

I've tried many different ways, the latest looks like this:

  1. in the setUp Thread Group, I'm defining some user variables using the Config element/User Defined Variables. Literal values work, but ${__P(globalPropName)} is substituted correctly in the local test, and remains the string ${__P(globalPropName)} in remote tests. This is obvious with using debug samplers.
  2. but in the result of the very same debug sampler, the property exists and has a valid value, so it's not the -J/-G problem.
  3. since variable substitution doesn't work, I can't use default values either.

I've tried using the substitutions directly in some items, like Number of Threads, but then the whole thing doesn't work as there is no substitution.

Funnily enough, simple variable substitutions like ${varname} work. Anything fancier does not. It's as if in the remote run the string parser is dumbed down on purpose.

Any ideas how to solve this?


Solution

  • So it looks like a misconfiguration in how the remote server is started up.

    The batch file (we're talking Windows here) goes like

    "C:\apache-jmeter-3.3\bin\jmeter.bat" -s -Dserver_port=1098 -j "C:\ows\jmeter-service-ows.log" -d "C:\ows"
    

    ...since all the miscellany files (source CSVs, result files, logs) should reside in C:\ows. But it turns out that Jmeter gets confused about its libraries then.

    When the batch file looks like this:

    "C:\apache-jmeter-3.3\bin\jmeter.bat" -s -Dserver_port=1098 -j "C:\ows\jmeter-service-ows.log" -d "C:\apache-jmeter-3.3"
    

    ...the test runs fine, with all substitutions working.

    I've checked the logs and the WARNings about Jmeter not being able to find any functions in the CompoundVariable class and in the first case they found none, in the second they find 'em all.

    I'm actually suspecting a bug as this test uses an additional external library (gson) which is situated in the same folder as the missing culprit (jmeter.functions or stg like that), and that particular library loaded just fine in both cases. What do you think, should I report this bug?