wpt_batch.py and custom connectivity

Hi Pat,

I’m trying to submit some batch jobs with custom connectivity profiles…

If I use the default profile everything is OK, but if I try to set a custom profile e.g.

I get

<bwDown>0</bwDown> <bwUp>0</bwUp> <latency>0</latency> <plr>('1',)</plr>

A similar thing happens if I leave the --plr out

<bwDown>0</bwDown> <bwUp>0</bwUp> <latency>0</latency> <plr>('0',)</plr>

Any ideas what I’m missing?

Any chance you can log the runtest.php url before it sends it out (or ping me and run it again so I can grab it from the access logs)?

Looking at the runtest.php code it looks like the bandwidth and latency params are extracted as ints and the plr is extracted as a string so the strange plr is probably happening to all of them and the int versions are just getting set to zero.

If I had to guess I would say that something on the python size is causing the test_params dictionary to encode the query params in a strange way but I’m not a big python guy so it may take me a little while to look into it.

Edit: Got time this week so dug into it and found the issue - guess no-one has used custom bandwidth with the batch submitter!

The URL being sent is:

http://www.webpagetest.org/runtest.php?bwIn=(2000,)&plr=(1,)&private=1&video=0&latency=(50,)&runs=1&f=xml&url=http://www.debenhams.com&k=apikey&priority=6&bwOut=(384,)&mv=1&location=Sydney:Chrome.custom&fvonly=1

The comma on the end of the following lines converts the value to a tuple

test_params['bwOut'] = options.bwup, test_params['bwIn'] = options.bwdown, test_params['latency'] = options.latency, test_params['plr'] = options.plr, test_params['location'] = options.location + '.custom'

Removing the commas i.e.

test_params['bwOut'] = options.bwup test_params['bwIn'] = options.bwdown test_params['latency'] = options.latency test_params['plr'] = options.plr test_params['location'] = options.location + '.custom'

Will give the correct query string values URL:

http://www.webpagetest.org/runtest.php?bwIn=2000&plr=1&private=1&video=0&latency=50&runs=1&f=xml&url=http://www.debenhams.com&k=apikey&priority=6&bwOut=384&mv=1&location=Sydney:Chrome.custom&fvonly=1

Awesome. Thanks for digging into it. I just pushed the fix.