Skip to content

Commit

Permalink
Fix error caching models in integ test (#68)
Browse files Browse the repository at this point in the history
Fixes bug caching model load in integ test. This leads to a new model
being loaded for each test. Now, only one model will be loaded,
preventing CB exceptions.

Signed-off-by: John Mazanec <[email protected]>
(cherry picked from commit 6068858)
  • Loading branch information
opensearch-trigger-bot[bot] authored Nov 11, 2022
1 parent d088a45 commit 5634ada
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ public class NeuralQueryIT extends BaseNeuralSearchIT {

private static final int TEST_DIMENSION = 768;
private static final SpaceType TEST_SPACE_TYPE = SpaceType.L2;
private static final AtomicReference<String> modelId = new AtomicReference<>();
private final float[] testVector = createRandomVector(TEST_DIMENSION);
private final AtomicReference<String> modelId = new AtomicReference<>();

@Before
public void setUp() throws Exception {
super.setUp();
modelId.compareAndSet(null, prepareModel());
if (modelId.get() == null) {
modelId.compareAndSet(null, prepareModel());
}
}

/**
Expand Down

0 comments on commit 5634ada

Please sign in to comment.