Skip to content

Commit 0052227

Browse files
committed
Ignore error during tests
1 parent 5f358cf commit 0052227

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/test/kotlin/eu/openanalytics/shinyproxyoperator/helpers/IntegrationTestBase.kt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ abstract class IntegrationTestBase {
127127
}
128128

129129
private suspend fun deleteNamespaces() {
130-
do {
130+
while (true) {
131131
for (managedNamespace in managedNamespaces) {
132132
try {
133133
val ns = stableClient.namespaces().withName(managedNamespace).get() ?: continue
@@ -141,7 +141,18 @@ abstract class IntegrationTestBase {
141141
}
142142
delay(1000)
143143
}
144-
} while (managedNamespaces.any { stableClient.namespaces().withName(it).get() != null })
144+
try {
145+
if (managedNamespaces.all { stableClient.namespaces().withName(it).get() == null }) {
146+
break
147+
}
148+
} catch (_: KubernetesClientException) {
149+
// ignore and try again
150+
} catch (_: RejectedExecutionException) {
151+
// ignore and try again
152+
} catch (_: InterruptedException) {
153+
// ignore and try again
154+
}
155+
}
145156
}
146157

147158
private suspend fun deleteCRD() {

0 commit comments

Comments
 (0)