Fix failing test due to concurrent product creation (#48989)

* Fix test due to concurrent product creation

* Add changefile(s) from automation for the following project(s): woocommerce
This commit is contained in:
Naman Malhotra 2024-07-02 02:49:18 +07:00 committed by GitHub
parent 97f8f863d1
commit ddc4bddc17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 28 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Comment: No changelog entry is required, as this just changes a unit test to workaround an issue.

View File

@ -16,34 +16,9 @@ class WC_REST_Product_Custom_Fields_Controller_Tests extends WC_REST_Unit_Test_C
* @return void
*/
public static function wpSetUpBeforeClass() {
self::$products[] = WC_Helper_Product::create_simple_product(
true,
array(
'name' => 'Pancake',
'sku' => 'pancake-1',
)
);
self::$products[] = WC_Helper_Product::create_simple_product(
true,
array(
'name' => 'Waffle 1',
'sku' => 'pancake-2',
)
);
self::$products[] = WC_Helper_Product::create_simple_product(
true,
array(
'name' => 'French Toast',
'sku' => 'waffle-2',
)
);
self::$products[] = WC_Helper_Product::create_simple_product(
true,
array(
'name' => 'Waffle 3',
'sku' => 'waffle-3',
)
);
for ( $i = 1; $i <= 4; $i ++ ) {
self::$products[] = WC_Helper_Product::create_simple_product();
}
foreach ( self::$products as $product ) {
for ( $i = 0; $i < 20; $i++ ) {