Skip to content

Commit 4ce8562

Browse files
committed
Modified generator to generate plugins
Signed-off-by: saimedhi <saimedhi@amazon.com>
1 parent 27bf22f commit 4ce8562

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

test_opensearchpy/test_server/test_plugins/test_knn.py

+5-17
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,14 @@ def test_knn_model(self) -> None:
7979
}
8080
})
8181

82-
time_out = time.time() + 900 # Waiting for model to train before searching it.
83-
82+
time_out = time.time() + 60 # Waiting for model to train before searching it.
83+
8484
while time.time() < time_out:
85-
8685
# Fetch the model state
87-
try:
88-
response = self.client.plugins.knn.get_model(model_id='my-model')
89-
if response['state'] != 'training':
90-
pass
91-
except Exception as error:
92-
print(f"Error fetching knn model: {error}")
86+
response = self.client.plugins.knn.get_model(model_id='my-model')
87+
if response['state'] != 'training':
9388
break
94-
95-
# Sleep for 1 minute before the next attempt
96-
time.sleep(10)
97-
98-
99-
100-
101-
#self.client.plugins.knn.get_model(model_id= 'my-model')
89+
time.sleep(5)
10290

10391
print("response", response)
10492
self.client.plugins.knn.delete_model(model_id= 'my-model')

0 commit comments

Comments
 (0)