Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Two unit tests were failing. You won't believe how I fixed it!
Browse files Browse the repository at this point in the history
  • Loading branch information
pimotte committed Aug 15, 2014
1 parent 3ed505a commit fa10785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ public CleanupOperationResult execute() throws Exception {

if (options.isRemoveOldVersions()) {
removeOldVersions();
}
}

remoteTransaction.commit();
// Committing in two steps because a) at this point it is atomic b) such that
// the purge file can be accounted for when merging, if needed
remoteTransaction = new RemoteTransaction(config, transferManager);

if (options.isMergeRemoteFiles()) {
mergeRemoteFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testUnreliableUpload() throws Exception {
// Format: abs=<count> rel=<count> op=<connect|init|upload|...> <operation description>

// 1st upload (= multichunk) fails
"rel=[345] .+upload.+multichunk", // << 3 retries!!
"rel=[456] .+upload.+multichunk", // << 3 retries!!

// Make fourth upload fail
"rel=(8|9|10) .+upload" // << 3 retries!!
Expand Down

2 comments on commit fa10785

@binwiederhier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely following this solution. But judging by your excitement in the commit message, there must be something ... well ... exciting about it? Can you elaborate?

@pimotte
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://www.commitstrip.com/en/2014/08/07/our-cto-has-discovered-an-incredible-way-of-making-developers-read-his-commit-messages-you-wont-even-believe-how-he-did-it/

(Though it was one of those revelations that just came to me after a good nights sleep, which is always nice.)

Please sign in to comment.