Skip to content

Commit 57eafb9

Browse files
committed
Merge branch '2.4-develop' of github.com:magento-commerce/magento2ce into platform-health
2 parents feae904 + ea236e7 commit 57eafb9

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<description value="Print Order from Guest on Frontend"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-38689"/>
18+
<skip>
19+
<issueId value="MQE-2834" />
20+
</skip>
1821
<group value="remote_storage_aws_s3"/>
1922
</annotations>
2023
<before>

app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<description value="To be sure that other elements of Success page are shown for placed order as registered Customer."/>
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="MC-16488"/>
18+
<skip>
19+
<issueId value="MQE-2834" />
20+
</skip>
1821
<group value="checkout"/>
1922
</annotations>
2023

app/code/Magento/QuoteGraphQl/Model/Cart/AddProductsToCart.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Magento\QuoteGraphQl\Model\Cart;
99

1010
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
11-
use Magento\Framework\Message\MessageInterface;
1211
use Magento\Quote\Api\CartRepositoryInterface;
1312
use Magento\Quote\Model\Quote;
1413

@@ -53,7 +52,6 @@ public function execute(Quote $cart, array $cartItems): void
5352
foreach ($cartItems as $cartItemData) {
5453
$this->addProductToCart->execute($cart, $cartItemData);
5554
}
56-
5755
$this->cartRepository->save($cart);
5856
}
5957
}

app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1414
use Magento\QuoteGraphQl\Model\Cart\AddProductsToCart;
1515
use Magento\QuoteGraphQl\Model\Cart\GetCartForUser;
16+
use Magento\Framework\Lock\LockManagerInterface;
1617

1718
/**
1819
* Add simple products to cart GraphQl resolver
@@ -30,16 +31,24 @@ class AddSimpleProductsToCart implements ResolverInterface
3031
*/
3132
private $addProductsToCart;
3233

34+
/**
35+
* @var LockManagerInterface
36+
*/
37+
private $lockManager;
38+
3339
/**
3440
* @param GetCartForUser $getCartForUser
3541
* @param AddProductsToCart $addProductsToCart
42+
* @param LockManagerInterface $lockManager
3643
*/
3744
public function __construct(
3845
GetCartForUser $getCartForUser,
39-
AddProductsToCart $addProductsToCart
46+
AddProductsToCart $addProductsToCart,
47+
LockManagerInterface $lockManager
4048
) {
4149
$this->getCartForUser = $getCartForUser;
4250
$this->addProductsToCart = $addProductsToCart;
51+
$this->lockManager = $lockManager;
4352
}
4453

4554
/**
@@ -58,12 +67,20 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
5867
throw new GraphQlInputException(__('Required parameter "cart_items" is missing'));
5968
}
6069
$cartItems = $args['input']['cart_items'];
61-
6270
$storeId = (int)$context->getExtensionAttributes()->getStore()->getId();
71+
72+
$lockName = 'cart_processing_lock_' . $maskedCartId;
73+
while ($this->lockManager->isLocked($lockName)) {
74+
// wait till other process working with the same cart complete
75+
usleep(rand(100, 600));
76+
}
77+
$this->lockManager->lock($lockName, 1);
78+
6379
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
6480
$this->addProductsToCart->execute($cart, $cartItems);
65-
6681
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
82+
83+
$this->lockManager->unlock($lockName);
6784
return [
6885
'cart' => [
6986
'model' => $cart,

app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<description value="Print Order from Guest on Frontend"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-28494"/>
19+
<skip>
20+
<issueId value="MQE-2834" />
21+
</skip>
1922
<group value="sales"/>
2023
<group value="mtf_migrated"/>
2124
</annotations>

app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<description value="Check while order printing URL with an id of not relevant order redirects to order history"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-28543"/>
19+
<skip>
20+
<issueId value="MQE-2834" />
21+
</skip>
1922
<group value="sales"/>
2023
</annotations>
2124
<before>

0 commit comments

Comments
 (0)