Skip to content

Commit e60bc14

Browse files
committed
[BUG] Getting DeadlineTimeoutException error during security tests after upgrading to 3.0
Signed-off-by: Andriy Redko <[email protected]>
1 parent 5b9ff98 commit e60bc14

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

notifications/notifications/src/test/kotlin/org/opensearch/integtest/PluginRestTestCase.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,19 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() {
111111
// create adminDN (super-admin) client
112112
val uri = javaClass.classLoader.getResource("security/sample.pem").toURI()
113113
val configPath = PathUtils.get(uri).parent.toAbsolutePath()
114-
SecureRestClientBuilder(settings, configPath).setSocketTimeout(60000).build()
114+
SecureRestClientBuilder(settings, configPath)
115+
.setSocketTimeout(60000)
116+
.setConnectionRequestTimeout(180000)
117+
.build()
115118
}
116119
false -> {
117120
// create client with passed user
118121
val userName = System.getProperty("user")
119122
val password = System.getProperty("password")
120-
SecureRestClientBuilder(hosts, isHttps(), userName, password).setSocketTimeout(60000).build()
123+
SecureRestClientBuilder(hosts, isHttps(), userName, password)
124+
.setSocketTimeout(60000)
125+
.setConnectionRequestTimeout(180000)
126+
.build()
121127
}
122128
}
123129
} else {

notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ class SecurityNotificationIT : PluginRestTestCase() {
3535

3636
@Before
3737
fun create() {
38-
39-
if (userClient == null) {
40-
createUser(user, user, arrayOf())
41-
userClient = SecureRestClientBuilder(clusterHosts.toTypedArray(), isHttps(), user, user).setSocketTimeout(60000).build()
42-
}
38+
createUser(user, user, arrayOf())
39+
userClient = SecureRestClientBuilder(clusterHosts.toTypedArray(), isHttps(), user, user)
40+
.setSocketTimeout(60000)
41+
.setConnectionRequestTimeout(180000)
42+
.build()
4343
}
4444

4545
@After
4646
fun cleanup() {
47-
4847
userClient?.close()
48+
userClient = null
4949
}
5050

5151
fun `test Create slack notification config with user that has create Notification permission`() {

0 commit comments

Comments
 (0)