File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
main/java/org/opensearch/ml/engine/encryptor
test/java/org/opensearch/ml/engine/encryptor Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ private void initMasterKey() {
181181 }));
182182
183183 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+ }
185188 } catch (InterruptedException e ) {
186189 throw new IllegalStateException (e );
187190 }
Original file line number Diff line number Diff line change @@ -462,8 +462,8 @@ public void decrypt() {
462462
463463 @ Test
464464 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." );
467467
468468 doAnswer (invocation -> {
469469 ActionListener <GetResponse > listener = invocation .getArgument (1 );
@@ -517,8 +517,8 @@ public void decrypt_NoResponseToInitConfigIndex() {
517517
518518 @ Test
519519 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." );
522522
523523 Metadata metadata = new Metadata .Builder ().indices (ImmutableMap .of ()).build ();
524524 when (clusterState .metadata ()).thenReturn (metadata );
You can’t perform that action at this time.
0 commit comments