#1827 closed defect (fixed)
Filename bug with automated tests
Reported by: | J. Max Mena | Owned by: | Smo |
---|---|---|---|
Priority: | minor | Milestone: | 2.3 |
Component: | tests | Version: | trunk |
Keywords: | Cc: |
Description
As discussed earlier, I'm writing up a ticket to document some strange behavior I was seeing with our machine that's running the automated tests regularly.
As is now, here's what the crontab looks like:
#Run the Daily Automated Tests 0 19 * * * /home/xpra/bin/runautomatedtests.sh #Run the TC Tests 30 0 * * * /home/xpra/bin/runtctests.sh #Run the Bandwidth Tests 30 4 * * * /home/xpra/bin/runbandwidthtests.sh #Update Xpra daily after running the tests 0 9 * * * /home/xpra/bin/updatexpra.sh
(Among a few other commented out scripts that are no longer enabled)
Here's what the top of runautomatedtests.sh
looks like:
#!/bin/bash export PATH=/usr/bin:/usr/sbin:/bin:/sbin export DISPLAY=:0 date="$(date +%Y%m%d%k%M)" ~/tests/xpra/test_measure_perf.py config_just_av ~/tests/xpra/data/automated/av_${date}_2_1.csv 1 2 2>&1 | tee ~/tests/xpra/data/automated/logs/av_${date}_2_1.log
And this one works correctly - every morning it runs all the tests and everything outputs correctly. The problematic one was runbandwidthtests.sh
and runtctests.sh
.
Here's the top of runbandwidthtests.sh
:
#!/bin/bash #Init variables export PATH=/usr/bin:/usr/sbin:/bin:/sbin export DISPLAY=:0 #export PYTHONPATH=/usr/lib/python2.7 date="$(date +%Y%m%d%k%M)" #Turn on mild bandwidth limits - start with 50mbits sudo tc qdisc add dev lo root netem rate 50mbit #Run the test ~/tests/xpra/test_measure_perf.py config_just_av ~/tests/xpra/data/automated/av_${date}_2_1_50mbit.csv 1 2 2>&1 | tee ~/tests/xpra/data/automated/logs/av_${date}_2_1_50mbit.log
And here's the top of runtctests.sh
:
#!/bin/bash #Init variables export PATH=/usr/bin:/usr/sbin:/bin:/sbin export DISPLAY=:0 date="$(date +%Y%m%d%k%M)" #Turn on light TC sudo tc qdisc add dev lo root netem delay 25ms 10ms 25% #Run the tests ~/tests/xpra/test_measure_perf.py config_just_av ~/tests/xpra/data/automated/av_${date}_2_1_lighttc.csv 1 2 2>&1 | tee ~/tests/xpra/data/automated/logs/av_${date}_2_1_lighttc.log ~/tests/xpra/test_measure_perf.py config_just_glx ~/tests/xpra/data/automated/glx_${date}_2_1_lighttc.csv 1 2 2>&1 | tee ~/tests/xpra/data/automated/logs/glx_${date}_2_1_lighttc.log ~/tests/xpra/test_measure_perf.py config_just_x11 ~/tests/xpra/data/automated/x11_${date}_2_1_lighttc.csv 1 2 2>&1 | tee ~/tests/xpra/data/automated/logs/x11_${date}_2_1_lighttc.log
And for some odd reason the last two don't output their files correctly - I end up with a file with no file ending that has the pattern prefix_date
with the rest of the filename argument as one of the start commands. For reference, here's a snippet from the file av_20180408
:
"png (vlc sound visual - None - None - unthrottled - via tcp)", "xpra", "2.3", "2.3", "030_2_2_bareedgeofwifi.csv 2 2", "Unversioned directory", "png", -1, -1, "llvmpipe (LLVM 4.0, 256 bits)", "vlc sound visual", 120, 1523189767.45, "8x Intel Xeon CPU E3-1230 v3 @ 3.30GHz", "x86_64", "4.14.4-200.fc26.x86_64", "X.Org X Server 1.19.3", "llvmpipe (LLVM 4.0, 256 bits)", "unknown", "1024x768", , , "tcp", 0, 0, 0, 81, 5230, 154, 5172974, 24, 14140132, 36414063, 45567324, 0, 884, 0, 4947850, 0, "", "", "", "", 44.0, 5.3, 14, 1181, 118, 57.3, 9.6, 7, 1429, 97, 12, 42, 76, , , , , , , , , , , , , 0, 15, 34, , , , , ,
This file is clearly a .CSV, and the first part contains 030_2_2_bareedgeofwifi.csv 2 2
, which should not be in the arguments.
So this is what I'm seeing. As a workaround I changed the date variable to not include the time, and only the date:
date="$(date +%Y%m%d)"
Attachments (3)
Change History (7)
Changed 4 years ago by
Attachment: | runautomatedtests.sh added |
---|
Changed 4 years ago by
Attachment: | runbandwidthtests.sh added |
---|
Changed 4 years ago by
Attachment: | runtctests.sh added |
---|
comment:1 Changed 4 years ago by
Owner: | changed from Antoine Martin to Smo |
---|
comment:2 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'm gonna intercept this one from Smo - I implemented the changes you suggested:
- Exit trap for TC rules
- Quotes around .CSV output filename
- pushd/popd functionality
That has completely solved this issue. I'm gonna go ahead and close this ticket as fixed.
comment:4 Changed 17 months ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1827
Looks like a case of missing quotes. I'm sure smo can help you there.
Personally, I would use something like:
Also, if you are adding tc rules in a script, you should ensure you remove them at the end using an exit trap.
If somehow they don't get removed, this could really badly skew the other results.