reproduction of resume error for node-downloader-helper
- build docker image -
docker build . -t node-downloader-helper - launch docker image in terminal 1 -
docker run -it --rm -p 3002:80 node-downloader-helper- leave it running with terminal open - open 2nd terminal, run download test -
node client/downloader.js - Wait until download starts (i.e. it starts printing download progress)
- ctrl+c on terminal 1 to stop the server, i.e. simulate the connection breaking
- note in terminal 2 that the retries start happening
- restart terminal 1, same commend as before in step 2
At this point the download will have failed and ignored the retry settings.
The way to reproduce this (i.e. the way this works) is that we have a server which alternates between sending an error/sending a test file. When the download client starts, it gets an error (which is due to hgouveia/node-downloader-helper#113), we then re-try which gets the file. When the server is restarted, the client will re-try which will get an error again, causing the issue.
The test file is just 10MB of random of zeros (dd if=/dev/zero of=test.file bs=1m count=10)
The nginx component is only there to limit bandwidth otherwise the transfer would be instant and we couldn't observe the issue.