Skip to content

Commit

Permalink
Fix an intermittent test failure.
Browse files Browse the repository at this point in the history
Both the C++ and python tests were using test/large_file.dat,
which means if they were run concurrently, they would sometimes
collide.  Avoid this by having them use different filenames.

Signed-off-by: Chris Lalancette <clalancette@osrfoundation.org>
  • Loading branch information
clalancette committed Mar 29, 2017
1 parent 3e3030b commit 0753a22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test.py
Expand Up @@ -12,11 +12,11 @@ def test_get_by_package():
assert res == 'A'.encode()

def test_get_large_file():
res_path = os.path.join(rospack.get_path("resource_retriever"), "test/large_file.dat")
res_path = os.path.join(rospack.get_path("resource_retriever"), "test/large_filepy.dat")
with open(res_path, 'w') as f:
for _ in range(1024*1024*50):
f.write('A')
res = r.get("package://resource_retriever/test/large_file.dat")
res = r.get("package://resource_retriever/test/large_filepy.dat")
assert len(res) == 1024*1024*50

def test_http():
Expand Down

0 comments on commit 0753a22

Please sign in to comment.