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

Wait for object to upload properly #4945

Closed
wants to merge 1 commit into from

Conversation

shtripat
Copy link
Contributor

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

Sometimes while mint tests, removal of object immediately after upload command fails with object not found. As the object may not be uploaded and reflected yet to the cluster, this can fail. Added a small sleep after upload to make sure object is available before any remove call.

Motivation and Context

How to test this PR?

mint tests would take care

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

Sometimes while mint tests, removal of object immediately after
upload command fails with object not found. As the object may not
be uploaded and reflected yet to the cluster, this can fail. Added
a small sleep after upload to make sure object is available before
any remove call.

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
@@ -1028,6 +1028,7 @@ function test_bucket_replication() {
break
fi
assert_success "$start_time" "${FUNCNAME[0]}" mc_cmd cp "$FILE_0_B" "${SERVER_ALIAS}/${bkt1}/${object_name}"
sleep 5s # to make sure objects reflects
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks more like you are trying to hide an underlying issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in local testing and even with play it always worked. only during CI while mint tests sometimes it fails.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shtripat A wait is never the solution. It may make it less likely - but AFAICT this shouldn't be needed in the first place, unless we are not consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but not sure as some cases it just fails immediate rm for the object which was uploaded using mc cp.
This test anyway was added for a scenario which in itself is very rare. May be we can just disable this test for the time being.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should figure out why it is failing in the first place.

@harshavardhana
Copy link
Member

As discussed removing this from mc instead write these tests directly on the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants