-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
58bdfb9
commit 4471071
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
appengine: added retry for P4SA propagation delay | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package google | ||
|
||
import ( | ||
"testing" | ||
|
||
"google.golang.org/api/googleapi" | ||
) | ||
|
||
func TestIsAppEngineRetryableError_operationInProgress(t *testing.T) { | ||
err := googleapi.Error{ | ||
Code: 409, | ||
Body: "Operation is already in progress", | ||
} | ||
isRetryable, _ := isAppEngineRetryableError(&err) | ||
if !isRetryable { | ||
t.Errorf("Error not detected as retryable") | ||
} | ||
} | ||
|
||
func TestIsAppEngineRetryableError_p4saPropagation(t *testing.T) { | ||
err := googleapi.Error{ | ||
Code: 404, | ||
Body: "Unable to retrieve P4SA: [[email protected]] from GAIA. Could be GAIA propagation delay or request from deleted apps.", | ||
} | ||
isRetryable, _ := isAppEngineRetryableError(&err) | ||
if !isRetryable { | ||
t.Errorf("Error not detected as retryable") | ||
} | ||
} | ||
|
||
func TestIsAppEngineRetryableError_missingPage(t *testing.T) { | ||
err := googleapi.Error{ | ||
Code: 404, | ||
Body: "Missing page", | ||
} | ||
isRetryable, _ := isAppEngineRetryableError(&err) | ||
if isRetryable { | ||
t.Errorf("Error incorrectly detected as retryable") | ||
} | ||
} | ||
|
||
func TestIsAppEngineRetryableError_serverError(t *testing.T) { | ||
err := googleapi.Error{ | ||
Code: 500, | ||
Body: "Unable to retrieve P4SA because of a bad thing happening", | ||
} | ||
isRetryable, _ := isAppEngineRetryableError(&err) | ||
if isRetryable { | ||
t.Errorf("Error incorrectly detected as retryable") | ||
} | ||
} |