Allow max retries to be specified for uploads.
[WIP] Passing but wrong test for publish retries.