From bba1b5c2dc1820d3a61f62701a09e50d8210880f Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Fri, 7 Jun 2024 15:48:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Flip=20incorrect=20percentages?= =?UTF-8?q?=20in=20error-reporting.js=20(#40048)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/error-reporting.js | 6 +++--- test/unit/test-error-reporting.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error-reporting.js b/src/error-reporting.js index 20f747708e30..d93367d91d8f 100644 --- a/src/error-reporting.js +++ b/src/error-reporting.js @@ -44,14 +44,14 @@ const ABORTED = 'AbortError'; * them, but we'd still like to report the rough number. * @const {number} */ -const NON_ACTIONABLE_ERROR_THROTTLE_THRESHOLD = 0.0001; +const NON_ACTIONABLE_ERROR_THROTTLE_THRESHOLD = 0.9999; /** * The threshold for errors throttled because nothing can be done about * them, but we'd still like to report the rough number. * @const {number} */ -const USER_ERROR_THROTTLE_THRESHOLD = 0.01; +const USER_ERROR_THROTTLE_THRESHOLD = 0.99; /** * The threshold for reporting errors to the beta error reporting endpoint @@ -66,7 +66,7 @@ const REPORT_ERROR_TO_BETA_ENDPOINT_THRESHOLD = 0.1; * be helpful to notify authors. * @const {number} */ -const NON_AMP_JS_ERROR_THRESHOLD = 0.01; +const NON_AMP_JS_ERROR_THRESHOLD = 0.99; /** * Throttles reports for the Stable version. diff --git a/test/unit/test-error-reporting.js b/test/unit/test-error-reporting.js index 6325f4213fc4..c295f74aea7b 100644 --- a/test/unit/test-error-reporting.js +++ b/test/unit/test-error-reporting.js @@ -533,7 +533,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => { }); it('should report throttled load errors at threshold', () => { - nextRandomNumber = 0.0001; + nextRandomNumber = 0.9999; const e = new Error('Failed to load:'); const data = getErrorReportData( undefined, @@ -560,7 +560,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => { }); it('should report throttled Script errors at threshold', () => { - nextRandomNumber = 0.0001; + nextRandomNumber = 0.9999; const e = new Error('Script error.'); const data = getErrorReportData( undefined, @@ -574,7 +574,7 @@ describes.sandboxed('getErrorReportData', {}, (env) => { }); it('should report throttled load errors under threshold', () => { - nextRandomNumber = 0.0001; + nextRandomNumber = 0.9999; const e = new Error('Failed to load:'); const data = getErrorReportData( undefined,