Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix client-rest-high-level tests for ppc64le. #12860

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ public void testMetrics() throws IOException {
DiscountedCumulativeGain::new,
() -> new ExpectedReciprocalRank(1)
);
double expectedScores[] = new double[] { 0.4285714285714286, 1.0, 0.75, 1.6408962261063627, 0.4407738095238095 };
double expectedScores[];
Copy link
Collaborator

@reta reta Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sunidhi-Gaonkar1 I see that differences are very negligible, we could improve assertion to take these precision differences into account

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should probably just be increasing delta (presently Double.MIN_VALUE to some expected decimal value) in assertion:

assertEquals(expectedScores[i], response.getMetricScore(), Double.MIN_VALUE);

if ((System.getProperty("os.arch").equals("ppc64le"))) {
expectedScores = new double[] { 0.4285714285714286, 1.0, 0.75, 1.6408962261063629, 0.4407738095238095 };
} else {
expectedScores = new double[] { 0.4285714285714286, 1.0, 0.75, 1.6408962261063627, 0.4407738095238095 };

}
int i = 0;
for (Supplier<EvaluationMetric> metricSupplier : metrics) {
RankEvalSpec spec = new RankEvalSpec(specifications, metricSupplier.get());
Expand Down
Loading