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

tests: Reduce context timeout to avoid false positives #881

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

harshavardhana
Copy link
Member

context timeout tests had long timeouts leading
to false positives in some cases when functional
tests are run against faster disks.

Reduce them such that the possibility of this
would never occur in future usage.

Fixes #880

@kannappanr
Copy link
Collaborator

kannappanr commented Nov 18, 2017

functional test on Travis failed for the following

{"alert":"","args":{"bucketName":"minio-go-testxns0okpetpou4rs6k","ctx":{"Context":0},"objectName":"0n1i3humrguu2dnrzrtgg0vaf49g3z"},"duration":156,"function":"GetObjectWithContext(ctx, bucketName, objectName)","message":"GetObjectWithContext failed due to non-cancellation upon short timeout","name":"minio-go","status":"fail"}

@harshavardhana
Copy link
Member Author

The PR is updated and fixed the context usage properly.

return
}
if _, err = r.Stat(); err == nil {
logError(function, args, startTime, "", "GetObjectWithContext did not failue to due to cancellation upon short timeout", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo ->failue

@harshavardhana
Copy link
Member Author

Any other concerns other than the typo ?

args["ctx"] = ctx
args["opts"] = minio.PutObjectOptions{ContentType: "binary/octet-stream"}
defer cancel()

_, err = c.PutObjectWithContext(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
if err != nil {
if err == nil {
Copy link
Collaborator

@kannappanr kannappanr Nov 19, 2017

Choose a reason for hiding this comment

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

Looks like this has been changed to expect the API to fail. If that is the case, the log message needs to reflect that.

return
}
ctx, cancel = context.WithTimeout(context.Background(), 3*time.Minute)
if _, err = r.Stat(); err == nil {
logError(function, args, startTime, "", "GetObjectWithContext did not failure to due to cancellation upon short timeout", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: failure needs to be fail

return
}
if _, err = r.Stat(); err == nil {
logError(function, args, startTime, "", "GetObjectWithContext did not failure to due to cancellation upon short timeout", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment needs to be clear

context timeout tests had long timeouts leading
to false positives in some cases when functional
tests are run against faster disks.

Reduce them such that the possibility of this
would never occur in future usage.

Fixes minio#880
@harshavardhana
Copy link
Member Author

fixed comments PTAL @kannappanr @poornas

Copy link
Collaborator

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

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

LGTM.

@nitisht nitisht merged commit 3419703 into minio:master Nov 20, 2017
@harshavardhana harshavardhana deleted the final-fix branch November 20, 2017 09:49
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