You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/23 07:58:36 UTC
[GitHub] [pulsar] hangc0276 opened a new pull request #11039: fix flaky AdminApiTest
hangc0276 opened a new pull request #11039:
URL: https://github.com/apache/pulsar/pull/11039
### Motivation
When running `AdminApiTest#testDeleteTenantForcefully`, it occurs flaky test fail.
```
java.lang.AssertionError: expected [false] but found [true]
at org.testng.Assert.fail(Assert.java:99)
at org.testng.Assert.failNotEquals(Assert.java:1037)
at org.testng.Assert.assertFalse(Assert.java:67)
at org.testng.Assert.assertFalse(Assert.java:77)
at org.apache.pulsar.broker.admin.AdminApiTest.testDeleteTenantForcefully(AdminApiTest.java:1222)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
```
The reason is when delete tenant, it doesn't invalid the deleted tenant info from MetadataCache, and then call `getTenants`, it will hit cache and retrun true.
### Modifications
1. add `Awaitility.await().untilAsserted` to wait MetadataCache refresh.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #11039: fix flaky AdminApiTest
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #11039:
URL: https://github.com/apache/pulsar/pull/11039#discussion_r656955151
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
##########
@@ -1219,7 +1219,9 @@ public void testDeleteTenantForcefully() throws Exception {
// delete tenant forcefully
admin.tenants().deleteTenant(tenant, true);
- assertFalse(admin.tenants().getTenants().contains(tenant));
Review comment:
fixing the problem this way is somehow closing the eyes in front of a problem.
if I delete a tenant I would like that if I run "pulsar-admin tenants list" the tenant is no more there
the "deleteTenant" operation is blocking and it must block until the operation succeeds and the system has a consistent view of the status of a such a "big entity".
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli merged pull request #11039: fix flaky AdminApiTest
Posted by GitBox <gi...@apache.org>.
eolivelli merged pull request #11039:
URL: https://github.com/apache/pulsar/pull/11039
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org