From 36202d744d8e578bbfd4f5d0729bb648c0de7ef8 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 12 May 2023 13:18:10 -0300 Subject: [PATCH] skip k6 batch update when batch create fails --- plugins/woocommerce/changelog/fix-k6-api-batch-orders | 4 ++++ plugins/woocommerce/tests/performance/requests/api/orders.js | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 plugins/woocommerce/changelog/fix-k6-api-batch-orders diff --git a/plugins/woocommerce/changelog/fix-k6-api-batch-orders b/plugins/woocommerce/changelog/fix-k6-api-batch-orders new file mode 100644 index 00000000000..f3489683645 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-k6-api-batch-orders @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +skip k6 batch update when batch create fails diff --git a/plugins/woocommerce/tests/performance/requests/api/orders.js b/plugins/woocommerce/tests/performance/requests/api/orders.js index f832fcc696a..26ca0fb6a98 100644 --- a/plugins/woocommerce/tests/performance/requests/api/orders.js +++ b/plugins/woocommerce/tests/performance/requests/api/orders.js @@ -186,6 +186,10 @@ export function ordersAPI() { group( 'API Batch Update Orders', function () { let updateBatchItem; + if ( ! post_ids ) { + return; + } + for ( let index = 0; index < batchSize; index++ ) { updateBatchItem = { id: `${ post_ids[ index ] }`,