Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: ZENKO-846 Add retry test #233

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

bennettbuchanan
Copy link

Adds the following test cases:

  • Tests for failed CRR retries (a single retry and up to 128 concurrent retries).
  • Test checking that the CRR metrics are properly updated when a retry occurs.

Automating these tests is proving especially challenging since we need to update the backbeat pod such that exponential back-off is very short (i.e. one second), so requires a unique backbeat pod with its configuration updated as such. Also, the test relies on deleting and recreating the destination bucket to create failures. This use of buckets is unreliable when multiple tests are using that same bucket. Ideas for strategies to automate these tests are welcome!

@bennettbuchanan bennettbuchanan force-pushed the feature/ZENKO-846/add-retry-test branch 2 times, most recently from 079220b to 1987b4f Compare July 28, 2018 00:30
@@ -15,12 +15,13 @@
"aws-sdk": "2.28.0",
"azure-storage": "^2.10.0",
"@google-cloud/storage": "^1.6.0",
"mocha": "2.3.4",
"mocha": "^5.2.0",
Copy link
Author

Choose a reason for hiding this comment

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

Need to update mocha version so that we can use this.retries.

@philipyoo
Copy link
Contributor

I think test is failing because the get request is made before data is available in redis. We can set a timeout before making the get request

@bennettbuchanan
Copy link
Author

I agree @philipyoo, there is definitely a race condition there. I've refactored that test to continually make the GET request in an async.doWhilst until the metrics have been updated (in this PR #221). 😸

const { results } = body.completions;
// We have reached an expiration of metrics.
if (results.count < prevCompletions.count) {
return callback(new Error('Invalid test case'));
Copy link
Contributor

@jonathan-gramain jonathan-gramain Jul 30, 2018

Choose a reason for hiding this comment

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

I'm not sure but a bug in the code may well trigger this case (bug in metrics returning less metrics than expected), so instead maybe use a regular assert?

Copy link
Author

Choose a reason for hiding this comment

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

Very good point. Updated.

assert.strictEqual((failures.results.size - prevFailures.size), 0);
}

function performRetries(N, keys, done) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: I think you could get rid of parameter N and use keys.length instead

Copy link
Author

Choose a reason for hiding this comment

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

Nice! Updated to remove that param.

@bennettbuchanan bennettbuchanan force-pushed the feature/ZENKO-846/add-retry-test branch 3 times, most recently from 722da87 to af4337f Compare August 1, 2018 17:06
@bennettbuchanan bennettbuchanan force-pushed the feature/ZENKO-846/add-retry-test branch from af4337f to 96df558 Compare August 1, 2018 19:15
@ssalaues ssalaues merged commit e017b63 into development/0.9 Aug 1, 2018
@ssalaues ssalaues deleted the feature/ZENKO-846/add-retry-test branch August 1, 2018 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants