From 76cc38d7bd448509cceb2e47ebc143e1a6cb9285 Mon Sep 17 00:00:00 2001 From: Jonathan Lane Date: Thu, 5 Oct 2023 23:25:15 -0700 Subject: [PATCH] A few fixes for API daily test execution (#40180) * Make check conditional * Changelog * Refactor based on PR feedback --------- Co-authored-by: Jon Lane --- .../changelog/api-minor-fixes-for-api-daily-flakiness | 4 ++++ .../api-core-tests/tests/shipping/shipping-zones.test.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/api-minor-fixes-for-api-daily-flakiness diff --git a/plugins/woocommerce/changelog/api-minor-fixes-for-api-daily-flakiness b/plugins/woocommerce/changelog/api-minor-fixes-for-api-daily-flakiness new file mode 100644 index 00000000000..12666be9d4d --- /dev/null +++ b/plugins/woocommerce/changelog/api-minor-fixes-for-api-daily-flakiness @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +A few fixes for API daily test flakiness diff --git a/plugins/woocommerce/tests/api-core-tests/tests/shipping/shipping-zones.test.js b/plugins/woocommerce/tests/api-core-tests/tests/shipping/shipping-zones.test.js index 33ce97ed23a..87769591c78 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/shipping/shipping-zones.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/shipping/shipping-zones.test.js @@ -171,7 +171,8 @@ test.describe.serial( 'Shipping zones API tests', () => { const putResponseStateOnlyJSON = await putResponseStateOnly.json(); await expect( putResponseStateOnly.status() ).toEqual( 200 ); - await expect( putResponseStateOnlyJSON ).toHaveLength(0); + // running on external hosts, this can be 0 or 1 + expect([0, 1]).toContain(putResponseStateOnlyJSON.length); } );