Skip to content

Commit

Permalink
replay tests: retry on network failure (#23383)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee authored Jan 4, 2022
1 parent 21ee6d2 commit 8dd8b19
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions selfdrive/ui/replay/tests/test_replay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ TEST_CASE("httpMultiPartDownload") {
const size_t chunk_size = 5 * 1024 * 1024;
std::string content;
SECTION("download to file") {
REQUIRE(httpDownload(TEST_RLOG_URL, filename, chunk_size));
bool ret = false;
for (int i = 0; i < 3 && !ret; ++i) {
ret = httpDownload(TEST_RLOG_URL, filename, chunk_size);
}
REQUIRE(ret);
content = util::read_file(filename);
}
SECTION("download to buffer") {
content = httpGet(TEST_RLOG_URL, chunk_size);
for (int i = 0; i < 3 && content.empty(); ++i) {
content = httpGet(TEST_RLOG_URL, chunk_size);
}
REQUIRE(!content.empty());
}
REQUIRE(content.size() == 9112651);
Expand Down

0 comments on commit 8dd8b19

Please sign in to comment.