Skip to content

Commit

Permalink
Modified generator to generate plugins
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Mar 22, 2024
1 parent 27bf22f commit 4ce8562
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions test_opensearchpy/test_server/test_plugins/test_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,14 @@ def test_knn_model(self) -> None:
}
})

time_out = time.time() + 900 # Waiting for model to train before searching it.
time_out = time.time() + 60 # Waiting for model to train before searching it.

while time.time() < time_out:

# Fetch the model state
try:
response = self.client.plugins.knn.get_model(model_id='my-model')
if response['state'] != 'training':
pass
except Exception as error:
print(f"Error fetching knn model: {error}")
response = self.client.plugins.knn.get_model(model_id='my-model')
if response['state'] != 'training':
break

# Sleep for 1 minute before the next attempt
time.sleep(10)




#self.client.plugins.knn.get_model(model_id= 'my-model')
time.sleep(5)

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

0 comments on commit 4ce8562

Please sign in to comment.