Skip to content

Commit 6369a54

Browse files
authored
remote-feature-flag-controller: Fix flaky test (#5730)
The test for `generateDeterministicRandomNumber` sometimes fails because it relies on the behavior of `uuidv4`, which is non-deterministic, and needs to be more lenient in the range of acceptable return values.
1 parent 10309a9 commit 6369a54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ describe('user-segmentation-utils', () => {
130130
distribution[Math.min(distributionIndex, 9)] += 1;
131131
});
132132

133-
// Each range should have roughly 10% of the values and 30% deviation
133+
// Each range should have roughly 10% of the values and 40% deviation
134134
const expectedPerRange = samples / ranges.length;
135-
const allowedDeviation = expectedPerRange * 0.3;
135+
const allowedDeviation = expectedPerRange * 0.4;
136136

137137
// Check distribution
138138
distribution.forEach((count) => {

0 commit comments

Comments
 (0)