ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.86k stars 17.31k forks source link

Autotest: Autotest scripts fail due to wrong path on mavproxy #6585

Closed karthikdesai closed 7 years ago

karthikdesai commented 7 years ago

Issue details

Running the autotest.py script with the following parameters. This

python Tools/autotest/autotest.py -j4 --skip build.All,build.Binaries,build.Examples,build.Parameters,build.ArduPlane,defaults.ArduPlane,fly.ArduPlane,fly.QuadPlane,build.APMrover2,build.ArduCopter,build.Helicopter,fly.CopterAVC,build.AntennaTracker,build.ArduSub,defaults.ArduSub,dive.ArduSub,convertgpx

This is run on Cygwin64 running on a Win10 PC.

The failure occurs when the script tries to find the path of the telemetery log of the Copter.

Path of the telemetry log location gets parsed wrongly. This can be seen on both Rover and Copter but only Copter reports this as a failure. The remaining part of the path can be seen 2 lines later

Rover_Part

Copter_Part

Version

Master

Platform

[ * ] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover

Airframe type

Hardware type

SITL

Logs

Log output from the console Logfile

I can also upload the logs that got generated from the autotest if needed!

OXINARF commented 7 years ago

@karthikdesai I'll say that although there are some problems with paths, the reason the autotest failrf is because Copter fails to do a mission after hitting the ground: https://gist.github.com/karthikdesai/e5602a2852c96777ba1a1baf113b3a4c#file-bamboo_autotest-log-L3497 Because the autotest is run in sequence and not in individual instances, all following tests fail too.

OXINARF commented 7 years ago

@peterbarker Can you look at the path issues? Specially https://gist.github.com/karthikdesai/e5602a2852c96777ba1a1baf113b3a4c#file-bamboo_autotest-log-L7936 Thanks.

peterbarker commented 7 years ago

Please remove C:\Users\INCAFLOW\AppData\Local/MAVProxy/mavinit.scr and retry

peterbarker commented 7 years ago

This line:

https://gist.github.com/karthikdesai/e5602a2852c96777ba1a1baf113b3a4c#file-bamboo_autotest-log-L1239

leads me to suspect MAVProxy.expect() isn't working correctly on Windows.

peterbarker commented 7 years ago

@karthikdesai Try changing timeout=1 to timeout=10 on this line: https://github.com/ardupilot/ardupilot/blob/master/Tools/autotest/pysim/util.py#L265

karthikdesai commented 7 years ago

@OXINARF Wow I didn't even notice the autotest of the copter failing! I was too fixated on getting the directory right!

So the test was successful! The timeout did the trick. Thanks @peterbarker . I also removed the mavinit.scr. But the test failed right after. Will restore it

Logfile for reference

karthikdesai commented 7 years ago

The rover still didn't get that right but reports a pass https://gist.github.com/karthikdesai/448f838a4c3ad624b297ebf370aa94f0#file-bamboo_autotest_success-log-L1190

But copter was no problem https://gist.github.com/karthikdesai/448f838a4c3ad624b297ebf370aa94f0#file-bamboo_autotest_success-log-L1679

karthikdesai commented 7 years ago

Right, repeated the same test and it fails with the same error. :/ Perhaps i got lucky the last time but not this time around Fail Log

https://gist.github.com/karthikdesai/af499ec2038e23a412b3a4e92bb763e8#file-bamboo_autotest_fail_1-L1678

peterbarker commented 7 years ago

Is this machine ridiculously loaded or for some other reason would suffer from severe performance problems?

It could theoretically be severe performance issue.

Its more likely there's some sort of buffering going on, and that we need to flush stuff out of mavproxy or something...

karthikdesai commented 7 years ago

@peterbarker Well throughtout the test, CPU was at 50%-60% ! But yes this server is kinda overloaded

And yeah regarding the flushing part here do you mean? https://github.com/ArduPilot/MAVProxy/blob/master/MAVProxy/mavproxy.py#L651 added this sys.stdout.flush() But there were other issues with cygwin with installing mavproxy.
(Cause i forgot to do a pip uninstall mavproxy before running the setup.py scripts! I checked the EGG and still the old mavproxy.py script was there) But if you think it would solve the issue at hand then will try it!

peterbarker commented 7 years ago

@karthikdesai Yes, please pursue the flush thing.

karthikdesai commented 7 years ago

@peterbarker So this got fixed. mavproxy.expect('Telemetry log: (\S+)\r\n') on https://github.com/ArduPilot/ardupilot/blob/master/Tools/autotest/arducopter.py#L1002 did the trick a PR from @amilcarlucas fixes this! #6630