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

[WIP] Negative tests for network interruption #106

Conversation

shreyas-s-rao
Copy link
Collaborator

@shreyas-s-rao shreyas-s-rao commented Jan 30, 2019

What this PR does / why we need it:
Negative tests for network interruption scenarios.

Which issue(s) this PR fixes:
fixes partially #73 and #104

Special notes for your reviewer:
This is only a first-cut version of setting up negative tests, and includes only network interruption cases, which might occur during calls to the object store.

Release note:

Negative tests for network interruption scenarios.

@shreyas-s-rao shreyas-s-rao added reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies status/in-progress Issue is in progress/work area/quality Output qualification (tests, checks, scans, automation in general, etc.) related component/etcd-backup-restore ETCD Backup & Restore exp/intermediate Issue that requires some project experience platform/all kind/test Test needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 30, 2019
Copy link
Collaborator

@amshuman-kr amshuman-kr left a comment

Choose a reason for hiding this comment

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

I have done a preliminary review. Please consider if the suggestions make sense.

@@ -136,6 +136,12 @@ func (p *fakePolicy) handleContainerGetOperation(w *http.Response) error {

// handleListObjectNames responds with a blob `List` response.
func (p *fakePolicy) handleListObjects(w *http.Response) error {
if networkTimeoutFlag {
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about a separate delegating errorPolicy implementation that delegates to fakePolicy if the flag is set? This way the fakePolicy implementation is not littered with if conditions.

Besides, the if conditions might proliferate for simulating latency or some other response error etc.This would apply to all the methods of fakePolicy that are modified below.

WDYT?

swiftStore snapstore.SnapStore
testObj *testing.T
swiftStore snapstore.SnapStore
networkTimeoutFlag bool = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will need eventually simulate other errors as well such as different HTTP errors, latency etc.

This flag is better kept in the fakePolicy or the errorPolicy I proposed rather than as a global flag.

@swapnilgm swapnilgm added this to the 0.6.0 milestone Feb 19, 2019
@swapnilgm swapnilgm removed this from the 0.6.0 milestone Mar 25, 2019
@swapnilgm
Copy link
Contributor

What is the status here? if it is matching with #173 can we close this in favor of other PR.?

@shreyas-s-rao
Copy link
Collaborator Author

@swapnilgm We can close this PR for now and reopen when necessary. Would be easier to run such negative test scenarios from infra perspective once we have etcd controller. WDYT?

@swapnilgm swapnilgm closed this Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/quality Output qualification (tests, checks, scans, automation in general, etc.) related component/etcd-backup-restore ETCD Backup & Restore exp/intermediate Issue that requires some project experience kind/test Test needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/all reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies status/in-progress Issue is in progress/work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants