Skip to content

Conversation

@xichen01
Copy link
Contributor

@xichen01 xichen01 commented Mar 6, 2024

What changes were proposed in this pull request?

Fix testParallelDeleteBucketAndCreateKey

The root cause is the preExecute#resolveBucketAndCheckKeyAcls of CreateKey may execute after deleteBucket, then the CreateKey#preExecute will throw an exception, so the test will fail. For fix this, we just need to add the waiting time.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10143

How was this patch tested?

Before, lots of failures.
https://github.com/xichen01/ozone/actions/runs/8158284595
After, All successful
https://github.com/xichen01/ozone/actions/runs/8158363756

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @xichen01 for the patch.

thread2.start();
Thread.sleep(2000);
// Wait long enough for createKey's preExecute to finish executing
Thread.sleep(10000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to waitFor some explicit condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but this needs to modify more codes. We need to know the preExecture has been executed completely, but the preExecture is a prviate method (or we need to add some flag to watch), I don't want ot modify it just for only one testing.
Add sleeping time is a dirty but quick solution. How do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @xichen01 for updating the patch.

Latest repeated run for reference:
https://github.com/xichen01/ozone/actions/runs/8358073042

@adoroszlai adoroszlai merged commit f9e5178 into apache:master Mar 24, 2024
smitajoshi12 pushed a commit to smitajoshi12/ozone that referenced this pull request Mar 27, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request May 29, 2024
…arallelDeleteBucketAndCreateKey (apache#6335)

(cherry picked from commit f9e5178)
xichen01 added a commit to xichen01/ozone that referenced this pull request Oct 1, 2024
…arallelDeleteBucketAndCreateKey (apache#6335)

(cherry picked from commit f9e5178)
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.

2 participants