mavlink / rust-mavlink

MAVLink library for Rust.
https://mavlink.github.io/rust-mavlink/mavlink/
Apache License 2.0
153 stars 78 forks source link

test failure - "test process_files::all" #104

Closed danieleades closed 2 years ago

danieleades commented 3 years ago

the test process_files::all test is failing

cargo test --features all-dialects

Processing file: /tmp/testlogs/ArduSub-test.tlog
recv error: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }
Number of parsed messages: 0
thread 'process_files::all' panicked at 'Unable to hit the necessary amount of matches', tests/process_log_files.rs:71:9

seeing this locally, as well as in CI

ddavid commented 2 years ago

Any news on this? The recv error seems to appear on any file-related connections.

@patrickelectric if you can point to a likely reason, I might be able to tackle this, since I need to read messages from a log file for a project at work.

patrickelectric commented 2 years ago

This is a problem of the ArduPilot organization where after a couple of months the tlog files are lost and are replaced by images.

file /tmp/testlogs/ArduSub-test.tlog                                                        
/tmp/testlogs/ArduSub-test.tlog: PNG image data, 600 x 600, 8-bit/color RGB, non-interlaced
patrickelectric commented 2 years ago

The test is disable for now

ddavid commented 2 years ago

Hi Patrick, you're right that the log files seem to be lost after some time. Would it make sense to add some test data to this repository, so you can keep the tests for log files?

I'm asking because the issue seems to be the same, even with valid binary log files. I've attached an example for which mavlink_dump fails, .zip for GitHub to accept it as an attachment. Is that expected? ArduPlane-MAVFTP-00000111.zip

I used https://plot.ardupilot.org/ to quickly validate the log file is good.

Using the d8de261ddf66a270834a1931565224880631cf1c master, I get the following:

./target/debug/mavlink-dump file:/home/hs-predator/Downloads/ArduPlane-MAVFTP-00000111.bin
recv error: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }

I tried changing the Mavlink protocol version and file endings. Am I missing something? With tcpin, udpin everything works as expected, so maybe something in the file-handling is broken?

patrickelectric commented 2 years ago

Hi Patrick, you're right that the log files seem to be lost after some time. Would it make sense to add some test data to this repository, so you can keep the tests for log files?

I'm asking because the issue seems to be the same, even with valid binary log files. I've attached an example for which mavlink_dump fails, .zip for GitHub to accept it as an attachment. Is that expected? ArduPlane-MAVFTP-00000111.zip

I used https://plot.ardupilot.org/ to quickly validate the log file is good.

Using the d8de261ddf66a270834a1931565224880631cf1c master, I get the following:

./target/debug/mavlink-dump file:/home/hs-predator/Downloads/ArduPlane-MAVFTP-00000111.bin
recv error: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }

I tried changing the Mavlink protocol version and file endings. Am I missing something? With tcpin, udpin everything works as expected, so maybe something in the file-handling is broken?

You should run a tlog file and not a .bin file, .bin are dataflash files.

patrickelectric commented 2 years ago

Done in # #110 #109