1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
19856: tests/net/gcoap_fileserver: Fix failing nightlies r=benpicco a=MrKevinWeiss


### Contribution description

This test has been failing inconsistently in the nightlies and sometimes on unrelated PRs. I was able to reproduce it with murdock and as soon as I added some print statements to the test it went away.  Since the issue is something to do with a failure when comparing 2 files after a node sends a file I am guessing that the comparison comes occasionally too fast and the file is not ready.

Maybe there is some more synchronization needed after a `ncput` but for now just adding a small sleep should prevent this issue.


### Testing procedure

Run murdock multiple times or try to get it failing on a local setup then apply the PR...


### Issues/PRs references



Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
This commit is contained in:
bors[bot] 2023-08-03 00:15:32 +00:00 committed by GitHub
commit bb9011c3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,11 @@ def test_linear_topology(factory, zep_dispatch):
# upload the file to node B (only one node should write MEMORY.bin)
A.cmd("ncput /const/song.txt coap://[" + global_addr(B.cmd("ifconfig 7"))[1] + "]/vfs/song2.txt", timeout=60)
# It seems like failures may occur due to the `ncput` command finishing but
# the data not being written to the file yet. Therefore, we wait a bit...
# This is just a guess though.
time.sleep(0.5)
# make sure the content matches
assert B.cmd("md5sum /nvm0/song.txt").split()[2] == B.cmd("md5sum /nvm0/song2.txt").split()[2]