-
Notifications
You must be signed in to change notification settings - Fork 2.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
Nessie: Fix testcase failures #7320
Conversation
@@ -98,12 +98,12 @@ public void testLoadNamespaceMetadata() { | |||
|
|||
@Test | |||
public void testListTables() { | |||
catalog.createTable(TableIdentifier.parse("foo.tbl1"), schema); | |||
createTable(catalog, TableIdentifier.parse("foo.tbl1"), schema); |
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.
why not just call catalog.createNamespace(Namespace.of("foo"), Collections.emptyMap());
at the beginning of these methods?
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.
Suggestion will work but I am following the style from other testcases in Nessie introduced in #7146
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.
The concern I have is that creating the namespace for each catalog instance might actually hide a bug. That's why I think it's better to create the namespace once before the test starts
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.
Fixed that creating namespace from another catalog part and still following the same style of other testcases. If still required to manually create a namespace, I can do that. But I don't think necessary.
Assertions.assertThat(catalog.listTables(Namespace.of("foo"))) | ||
.containsExactlyInAnyOrder(TableIdentifier.parse("foo.tbl1")); | ||
|
||
// another client creates a table with the same nessie server | ||
anotherCatalog.createTable(TableIdentifier.parse("foo.tbl2"), schema); | ||
createTable(anotherCatalog, TableIdentifier.parse("foo.tbl2"), schema); |
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 don't think it's necessary to potentially create the namespace again here. Just calling catalog.createNamespace(Namespace.of("foo"), Collections.emptyMap());
at the beginning of the method should be enough.
Same applies for the other test methods in this class that fail.
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.
yeah, creating again from a different client is not required as namespace already exist. I removed it.
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.
Thanks for fixing this so quickly @ajantha-bhat
PR is ready for merging. |
Thanks @stevenzwu for merging :) |
merge this to fix the master branch build failure. thanks @ajantha-bhat for the fix and @nastra @Fokko @dimas-b for the review |
#6789 was merged recently and the PR didn't rebase before merging as there was no conflict.
But there was another PR that got merged #7146 which enforces the namespace creation. Hence the new tests failed.
Apologies for breaking the master build!