-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Re-enable Nessie namespace/table visibility tests #18124
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for fixing this! Just one non-blocking comments, is it possible to do some clean up after or before each test? otherwise these tests are still brittle especially when we add new tests with the same namespace name in the future.
@beinan yes that makes perfect sense to do that. I added some cleanup after each test that deletes all branches/tags and also improved the overall isolation in the tests so that parallel runs don't interfere with each other |
b3c4522
to
366d0e7
Compare
@beinan turns out this isn't as trivial as I thought, because the query runner with nessie is usually created at the class level, while we clean up and therefore modify the underlying references at the test level (which means we're modifying the underlying state of the query runner). |
Sure. I can check in my free time. |
ping @ajantha-bhat! |
@rohanpednekar : Thanks for the remainder. I will handle it this week. |
1affedc
to
9d5ed68
Compare
@@ -27,7 +27,7 @@ | |||
{ | |||
private static final Logger log = Logger.get(NessieContainer.class); | |||
|
|||
public static final String DEFAULT_IMAGE = "projectnessie/nessie:0.30.0"; | |||
public static final String DEFAULT_IMAGE = "projectnessie/nessie:0.43.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just aligning the nessie version with the one being used in the presto-iceberg
pom
It appears that |
@@ -38,6 +40,7 @@ | |||
import static com.facebook.presto.tests.QueryAssertions.assertEqualsIgnoreOrder; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
|
|||
@Test(singleThreaded = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you have made it single-threaded execution because resetData
will clean all the branches including the concurrently executing test case's branches.
So, maybe the efficient way is to have testcase level clean-up which only drop the branches it created (instead of generic cleanup) and ensuring none of the testcase commits on default branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of doing cleanup within a test method itself, because you'd have to wrap the entire test method code in a try-finally
to guarantee that cleanup runs at the end of the method.
This test class has 3 tests in total, so running this single-threaded just makes the test more predictable and less prone to concurrent cleanup/execution and shouldn't affect CI time too much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just 3 test cases. So, I don't mind single-threaded execution.
The current implementation sounds good to me.
@beinan, @rohanpednekar: We have added the clean-up in this PR itself today. So, there won't any follow PR from me for the same. |
@beinan could you re-review this one please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, @ChunxuTang do you want to take a look also?
@beinan @ChunxuTang is this something that we can merge? |
This also cleans up branches/tags after each test.
@beinan any idea why a different and unrelated CI action fails randomly? |
@nastra Let me rerun the tests and see whether they could pass this time. |
@ChunxuTang looks like CI is passing, is this good to be merged then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
testTableDataVisibility()
andtestNamespaceVisibility
are both using the same namespace names (wherenamespace_one
is created on themain
branch), so it's possible that those tests interfere with each other if the tests run in parallel