Commit e140571 1 parent e9921e2 commit e140571 Copy full SHA for e140571
File tree 2 files changed +8
-5
lines changed
main/java/org/opensearch/ml/engine/encryptor
test/java/org/opensearch/ml/engine/encryptor
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ private void initMasterKey() {
181
181
}));
182
182
183
183
try {
184
- latch .await (1 , SECONDS );
184
+ boolean completed = latch .await (3 , SECONDS );
185
+ if (!completed ) {
186
+ throw new MLException ("Fetching master key timed out." );
187
+ }
185
188
} catch (InterruptedException e ) {
186
189
throw new IllegalStateException (e );
187
190
}
Original file line number Diff line number Diff line change @@ -462,8 +462,8 @@ public void decrypt() {
462
462
463
463
@ Test
464
464
public void encrypt_NullMasterKey_NullMasterKey_MasterKeyNotExistInIndex () {
465
- exceptionRule .expect (ResourceNotFoundException .class );
466
- exceptionRule .expectMessage (MASTER_KEY_NOT_READY_ERROR );
465
+ exceptionRule .expect (MLException .class );
466
+ exceptionRule .expectMessage ("Fetching master key timed out." );
467
467
468
468
doAnswer (invocation -> {
469
469
ActionListener <GetResponse > listener = invocation .getArgument (1 );
@@ -517,8 +517,8 @@ public void decrypt_NoResponseToInitConfigIndex() {
517
517
518
518
@ Test
519
519
public void decrypt_MLConfigIndexNotFound () {
520
- exceptionRule .expect (ResourceNotFoundException .class );
521
- exceptionRule .expectMessage (MASTER_KEY_NOT_READY_ERROR );
520
+ exceptionRule .expect (MLException .class );
521
+ exceptionRule .expectMessage ("Fetching master key timed out." );
522
522
523
523
Metadata metadata = new Metadata .Builder ().indices (ImmutableMap .of ()).build ();
524
524
when (clusterState .metadata ()).thenReturn (metadata );
You can’t perform that action at this time.
0 commit comments