Closed rikonen closed 1 year ago
Those tests look somewhat unrelated since the failing tests don't even import the code that was changed. But looks like the failures are consistent and main hasn't failed with the same, though last test run for main was a long time ago so could be something has broken since.
It looks like the reasons the tests are failing are related to https://github.com/aiven/rohmu/pull/69.
A minor detail but it would be better to write the code differently: either use an else clause in the loop instead of testing for the "range - 1" attempt, or make it obvious. Eg, either:
max_retry = 6
for i in range(max_retry):
....
else:
self.log.error("Download stalled despite retries, aborting")
self.errors = 1
Or:
max_retry = 6
for i in range(max_retry):
if i == max_retry -1:
...
I'm in favor of the first one.
I'll revert the change to rohmu, it was creating some issues in some dev environments as well.
Added a constant for max retries to get rid of the magic numbers spread around the code.
@rikonen I encountered a similar issue in this escalation, but I also had to increase the allowed stalled time to get it to complete.
rohmu with reverted change needs to be released in PyPi so that tests are passing, I guess @alanfranz is working on it.
Merging #557 (1693152) into main (3be6acf) will increase coverage by
0.04%
. The diff coverage is100.00%
.
In some rare cases 3 retries isn't enough but 6 is. This should really be made configurable but creating this pr as a quick fix in case nobody else feels like creating a better one.