0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-53402 Relax assertion to account for precision loss in stddev calculation

This commit is contained in:
Nick Zolnierz 2021-03-04 09:18:36 -05:00 committed by Evergreen Agent
parent 9e92a6d17e
commit 9c9a881539

View File

@ -100,9 +100,18 @@ function testAccumAgainstGroup(coll, accum) {
});
}
assert.eq(groupRes,
wfResults[index].res,
"Window function result for index " + index + ": " + tojson(wfRes));
// On DEBUG builds, the computed $group may be slightly different due to precision
// loss when spilling to disk.
// TODO SERVER-42616: Enable the exact check for $stdDevPop/Samp.
if (accum == "$stdDevSamp" || accum == "$stdDevPop")
assert.close(groupRes,
wfResults[index].res,
"Window function result for index " + index + ": " + tojson(wfRes),
10 /* 10 decimal places */);
else
assert.eq(groupRes,
wfResults[index].res,
"Window function result for index " + index + ": " + tojson(wfRes));
}
});
});