-
Notifications
You must be signed in to change notification settings - Fork 9
Fix intermittent failures in AccountServiceTests #78
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
Conversation
try { | ||
restResponse = accountService.getAccounts(request); | ||
break; // Success, exit the retry loop | ||
} catch (GenabilityException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming the not found case / 404 is a Genability Exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the not found case is a 500
GenabilityException: Failed GET http://family-main-preview/rest/v1/accounts?fields=ext&pageCount=5&search=JAVA+CLIENT+TEST+ACCOUNT&searchOn=accountName: HTTP error code : 500
throw e; // Re-throw if we've exhausted retries | ||
} | ||
|
||
System.out.println("Search request failed, retrying (" + retryCount + "/" + maxRetries + ")"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this logging line. If we need to log, we should use a framework provided logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also consider breaking out the magic numbers (maxretry, sleep time) as statics on top of the class.
Problem
The testPaginatedAccountList test in AccountServiceTests was experiencing intermittent 500 errors when searching for newly created accounts:
GenabilityException: Failed GET http://family-main-preview/rest/v1/accounts?fields=ext&pageCount=5&search=JAVA+CLIENT+TEST+ACCOUNT&searchOn=accountName: HTTP error code : 500
The issue occurred because:
Previous PR: #76 (tackling each tests separately now)