Closed 0ctopus13prime closed 2 weeks ago
Will check the failure in Windows
The failure does not seem like related to the change. It failed to get a value from mocking instance.
We set the mocking here, but for some reasons, the mocked value is not being returned in Windows. I'm suspecting this is a concurrent issue in testing.
Model mockModel = new Model(modelMetadata1, modelBlob, modelId);
when(modelDao.get(modelId)).thenReturn(mockModel); <---------------- This should return 'test-model'
when(modelDao.getMetadata(modelId)).thenReturn(modelMetadata1);
Error :
1> java.lang.IllegalArgumentException: Model ID 'test-model' is not created.
1> at org.opensearch.knn.indices.ModelUtil.getModelMetadata(ModelUtil.java:54)
1> at org.opensearch.knn.common.FieldInfoExtractor.extractKNNEngine(FieldInfoExtractor.java:42)
1> at org.opensearch.knn.index.codec.util.KNNCodecUtil.getNativeKNNEngine(KNNCodecUtil.java:126)
Reran the test. If it is still failing, then will fix the code in Windows and reraise the PR!
All tests passed :sweat_smile:
Will merge the PR.
Also will create a new issue regarding the mocking failure.
Description
Backporting #2241 to 2.x branch.