processone / tsung

Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc.
http://www.process-one.net/en/tsung/
GNU General Public License v2.0
2.54k stars 405 forks source link

Cannot use dynamic variable in timeout #328

Open Navgeet opened 6 years ago

Navgeet commented 6 years ago

Hi, I'm testing an MQTT server with the following config. I need to specify a random timeout in waitForMessages. My config looks like this:

        <setdynvars sourcetype="random_number" start="1" end="10">
          <var name="wait" />
        </setdynvars>

        <request>
          <mqtt type="waitForMessages" timeout="%%_wait%%"></mqtt>
        </request>

I get the following exception:

    ts_config_server:(0:<0.101.0>) Error while parsing XML config file: {{case_clause,
                                                                          {ok,
                                                                           [],
                                                                           1}},
                                                                         [{ts_config,
                                                                           getTypeAttr,
                                                                           2,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config.erl"},
                                                                            {line,
                                                                             1143}]},
                                                                          {ts_config_mqtt,
                                                                           parse_config,
                                                                           2,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config_mqtt.erl"},
                                                                            {line,
                                                                             79}]},
                                                                          {lists,
                                                                           foldl,
                                                                           3,
                                                                           [{file,
                                                                             "lists.erl"},
                                                                            {line,
                                                                             1263}]},
                                                                          {ts_config,
                                                                           parse,
                                                                           2,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config.erl"},
                                                                            {line,
                                                                             526}]},
                                                                          {lists,
                                                                           foldl,
                                                                           3,
                                                                           [{file,
                                                                             "lists.erl"},
                                                                            {line,
                                                                             1263}]},
                                                                          {ts_config,
                                                                           handle_read,
                                                                           3,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config.erl"},
                                                                            {line,
                                                                             85}]},
                                                                          {ts_config,
                                                                           read,
                                                                           2,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config.erl"},
                                                                            {line,
                                                                             70}]},
                                                                          {ts_config_server,
                                                                           handle_call,
                                                                           3,
                                                                           [{file,
                                                                             "src/tsung_controller/ts_config_server.erl"},
                                                                            {line,
                                                                             209}]}]}