thswlsqls commented on code in PR #18035:
URL: https://github.com/apache/iceberg/pull/18035#discussion_r4032180949
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestMultipleClients.java:
##########
@@ -111,6 +111,19 @@ public void testListNamespaces() throws
NessieConflictException, NessieNotFoundE
"Cannot list child namespaces from 'db1': ref '%s' is no longer
valid", branch);
}
+ @Test
+ void listNestedNamespacesFromAnotherClient() {
+ // pins the other client to the current ref hash
Review Comment:
@ebyhr @uros-b Thanks — you're right, "pins" is the wrong word, and I've
reworded the comment.
That first call is only there to make `anotherCatalog` resolve its reference
before the commits below, so the hash it memoizes is older than those commits.
On main that cached hash is what the parent-namespace check uses via
`getReference()`, which is what the test needs to reproduce; the listing itself
goes through `withReference` and reads the ref by name, as you said.
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestMultipleClients.java:
##########
@@ -111,6 +111,19 @@ public void testListNamespaces() throws
NessieConflictException, NessieNotFoundE
"Cannot list child namespaces from 'db1': ref '%s' is no longer
valid", branch);
}
+ @Test
+ void listNestedNamespacesFromAnotherClient() {
+ // pins the other client to the current ref hash
+ assertThat(anotherCatalog.listNamespaces()).isEmpty();
+
+ catalog.createNamespace(Namespace.of("db1"), Collections.emptyMap());
+ catalog.createNamespace(Namespace.of("db1", "sub1"),
Collections.emptyMap());
+
+ // the other client is still on the old ref hash, but listing reads the
HEAD of the ref
+ assertThat(anotherCatalog.listNamespaces(Namespace.of("db1")))
+ .containsExactlyInAnyOrder(Namespace.of("db1", "sub1"));
Review Comment:
@ebyhr Thanks — switched to `containsExactly`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]