ekaterinadimitrova2 commented on code in PR #2648:
URL: https://github.com/apache/cassandra/pull/2648#discussion_r1321772751
##########
test/unit/org/apache/cassandra/tools/nodetool/InvalidateCIDRPermissionsCacheTest.java:
##########
@@ -118,10 +115,13 @@ public void testInvalidateSingleCidrPermission()
// ensure cidr permission is cached
role.hasAccessFromIp(ipAddr);
assertThat(originalReadsCount).isEqualTo(getCidrPermissionsReadCount());
+ assertThat(((CassandraCIDRAuthorizer)
DatabaseDescriptor.getCIDRAuthorizer()).has(ROLE_A)).isTrue();
// invalidate cidr permission
ToolRunner.ToolResult tool =
ToolRunner.invokeNodetool("invalidatecidrpermissionscache",
ROLE_A.getRoleName());
tool.assertOnCleanExit();
+ assertThat(tool.getStdout()).contains("Invalidated the role role_a
from CIDR permissions cache");
Review Comment:
You are right, and this repeated run proves it - very rarely, but it can be
flaky -
https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2496/workflows/6ec742b1-7b6d-4ea9-b81a-36486da34e14/jobs/39036
One way is probably to use the Util#flakyTest to rerun it once if it fails?
Another is now when we have
https://github.com/apache/cassandra/pull/2648/files#diff-02dc3c7a2a64aef7633ac085c24deddfed1b32b469c9958f2c04d5e228e6144fR42
to rely on that message but that one is not always generated and we don't
check the particular roles were invalidated. Open for other ideas, too.
--
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]