File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
x-pack/plugin/rank-rrf/src/test/java/org/elasticsearch/xpack/rank/rrf Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3737import org .elasticsearch .xcontent .json .JsonXContent ;
3838
3939import java .io .IOException ;
40+ import java .util .Arrays ;
4041import java .util .HashMap ;
4142import java .util .HashSet ;
4243import java .util .List ;
@@ -511,7 +512,12 @@ public void testInferenceFieldWeights() {
511512
512513 assertNotNull ("Inner RRFRetrieverBuilder should exist" , innerRrf );
513514 float [] actualWeights = innerRrf .weights ();
515+ assertEquals ("Should have exactly 2 weights" , 2 , actualWeights .length );
516+
517+ // Sort both arrays to ensure deterministic comparison regardless of HashMap iteration order
514518 float [] expectedWeights = new float [] { 3.0f , 0.5f };
519+ Arrays .sort (actualWeights );
520+ Arrays .sort (expectedWeights );
515521 assertArrayEquals (expectedWeights , actualWeights , 0.001f );
516522 }
517523
You can’t perform that action at this time.
0 commit comments