fix: address test failure by using the previous log (#27172)

closes: #26790

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2024-02-20 13:09:51 -05:00 committed by GitHub
parent 52fe8b0feb
commit 7ea595d27b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,8 +89,11 @@ public class WatchedSecretsTest extends BaseOperatorTest {
k8sclient.resource(dbSecret).update(); k8sclient.resource(dbSecret).update();
// dynamically check pod 0 to avoid race conditions // dynamically check pod 0 to avoid race conditions
Awaitility.await().atMost(1, TimeUnit.MINUTES).ignoreExceptions().until(() -> Awaitility.await().atMost(1, TimeUnit.MINUTES).ignoreExceptions()
k8sclient.pods().withName(kc.getMetadata().getName() + "-0").getLog().contains("password authentication failed for user \"" + username + "\"")); .until(() -> k8sclient
.raw(String.format("/api/v1/namespaces/%s/pods/%s/log?previous=true", namespace,
kc.getMetadata().getName() + "-0"))
.contains("password authentication failed for user \"" + username + "\""));
} }
private StatefulSet getStatefulSet(Keycloak kc) { private StatefulSet getStatefulSet(Keycloak kc) {