markap14 commented on code in PR #11684:
URL: https://github.com/apache/nifi/pull/11684#discussion_r4515928161
##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/registry/RegistryClientIT.java:
##########
@@ -57,6 +58,18 @@ public class RegistryClientIT extends NiFiSystemIT {
public static final String TEST_FLOWS_BUCKET = "test-flows";
public static final String FIRST_FLOW_ID = "first-flow";
+ private static final String RESTART_SYNCHRONIZATION_TEST_NAME =
"testVersionControlledProcessGroupSynchronizesAfterRestart()";
+ private static final long VERSION_CONTROL_SYNC_TIMEOUT_SECONDS = 55;
+
+ @Override
+ protected boolean isAllowFactoryReuse() {
+ return !RESTART_SYNCHRONIZATION_TEST_NAME.equals(getTestName()) &&
super.isAllowFactoryReuse();
+ }
+
+ @Override
+ protected boolean isDestroyEnvironmentAfterEachTest() {
+ return RESTART_SYNCHRONIZATION_TEST_NAME.equals(getTestName()) ||
super.isDestroyEnvironmentAfterEachTest();
+ }
Review Comment:
[Claude Opus 5.5] Choosing whether to reuse the instance by matching the
test's display name is fragile. If the test is renamed, or the display name
format changes, the string stops matching. Nothing fails at that point. The
isolation just stops, and later tests silently run on an instance that still
has the Registry Client with the 15-second `Validate Sleep Time`. Because
`destroyFlow()` does not delete Registry Clients, that client slows validation
for every later test that reuses the instance, including any later restart.
Keeping the test in `RegistryClientIT` would be nice, but not if it needs
this name check. Either of these would work:
1. Reset `Validate Sleep Time` back to `0 sec` in a `finally` block at the
end of the test, and remove both overrides.
2. Move the test into its own class that always returns `false` from
`isAllowFactoryReuse()` and `true` from `isDestroyEnvironmentAfterEachTest()`.
Either way, please remove the `RESTART_SYNCHRONIZATION_TEST_NAME` constant
and the name-based overrides.
--
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]