Skip to content

Commit d1b6e08

Browse files
committed
MAGE-844 Defer QueueTest due to cross connection transactional deadlocks
1 parent 06f4281 commit d1b6e08

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

Test/Integration/QueueTest.php

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
class QueueTest extends TestCase
1515
{
16+
private const INCOMPLETE_REASON = "Must revisit transaction handling across connections.";
17+
1618
/** @var JobsCollectionFactory */
1719
private $jobsCollectionFactory;
1820

@@ -72,9 +74,14 @@ public function testFill()
7274
}
7375
}
7476

75-
/** @depends testFill */
77+
/**
78+
* @depends testFill
79+
* @magentoDbIsolation disabled
80+
*/
7681
public function testExecute()
7782
{
83+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
84+
7885
$this->setConfig('algoliasearch_queue/queue/active', '1');
7986

8087
/** @var Queue $queue */
@@ -125,6 +132,8 @@ public function testExecute()
125132

126133
public function testSettings()
127134
{
135+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
136+
128137
$this->resetConfigs([
129138
'algoliasearch_queue/queue/number_of_job_to_run',
130139
'algoliasearch_advanced/advanced/number_of_element_by_page',
@@ -158,13 +167,15 @@ public function testSettings()
158167

159168
$this->algoliaHelper->waitLastTask();
160169

161-
$settings = $this->algoliaHelper->getIndex($this->indexPrefix . 'default_products')->getSettings();
170+
$settings = $this->algoliaHelper->getSettings($this->indexPrefix . 'default_products');
162171
$this->assertFalse(empty($settings['attributesForFaceting']), 'AttributesForFacetting should be set, but they are not.');
163172
$this->assertFalse(empty($settings['searchableAttributes']), 'SearchableAttributes should be set, but they are not.');
164173
}
165174

166175
public function testMergeSettings()
167176
{
177+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
178+
168179
$this->setConfig('algoliasearch_queue/queue/active', '1');
169180
$this->setConfig('algoliasearch_queue/queue/number_of_job_to_run', 1);
170181
$this->setConfig('algoliasearch_advanced/advanced/number_of_element_by_page', 300);
@@ -180,10 +191,10 @@ public function testMergeSettings()
180191

181192
$productionIndexName = $this->indexPrefix . 'default_products';
182193

183-
$res = $this->algoliaHelper->getIndex($productionIndexName)->setSettings(['disableTypoToleranceOnAttributes' => ['sku']]);
184-
$this->algoliaHelper->waitLastTask($productionIndexName, $res['taskID']);
194+
$res = $this->algoliaHelper->setSettings($productionIndexName, ['disableTypoToleranceOnAttributes' => ['sku']]);
195+
$this->algoliaHelper->waitLastTask();
185196

186-
$settings = $this->algoliaHelper->getIndex($productionIndexName)->getSettings();
197+
$settings = $this->algoliaHelper->getSettings($productionIndexName);
187198
$this->assertEquals(['sku'], $settings['disableTypoToleranceOnAttributes']);
188199

189200
/** @var QueueRunner $queueRunner */
@@ -192,18 +203,20 @@ public function testMergeSettings()
192203

193204
$this->algoliaHelper->waitLastTask();
194205

195-
$settings = $this->algoliaHelper->getIndex($this->indexPrefix . 'default_products_tmp')->getSettings();
206+
$settings = $this->algoliaHelper->getSettings($this->indexPrefix . 'default_products_tmp');
196207
$this->assertEquals(['sku'], $settings['disableTypoToleranceOnAttributes']);
197208

198209
$queueRunner->executeFull();
199210
$queueRunner->executeFull();
200211

201-
$settings = $this->algoliaHelper->getIndex($productionIndexName)->getSettings();
212+
$settings = $this->algoliaHelper->getSettings($productionIndexName);
202213
$this->assertEquals(['sku'], $settings['disableTypoToleranceOnAttributes']);
203214
}
204215

205216
public function testMerging()
206217
{
218+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
219+
207220
$this->connection->query('DELETE FROM algoliasearch_queue');
208221

209222
$data = [
@@ -566,6 +579,8 @@ public function testMergingWithStaticMethods()
566579

567580
public function testGetJobs()
568581
{
582+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
583+
569584
$this->connection->query('TRUNCATE TABLE algoliasearch_queue');
570585

571586
$data = [
@@ -782,6 +797,8 @@ public function testGetJobs()
782797

783798
public function testHugeJob()
784799
{
800+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
801+
785802
// Default value - maxBatchSize = 1000
786803
$this->setConfig('algoliasearch_queue/queue/number_of_job_to_run', 10);
787804
$this->setConfig('algoliasearch_advanced/advanced/number_of_element_by_page', 100);
@@ -820,6 +837,8 @@ public function testHugeJob()
820837

821838
public function testMaxSingleJobSize()
822839
{
840+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
841+
823842
// Default value - maxBatchSize = 1000
824843
$this->setConfig('algoliasearch_queue/queue/number_of_job_to_run', 10);
825844
$this->setConfig('algoliasearch_advanced/advanced/number_of_element_by_page', 100);
@@ -864,6 +883,8 @@ public function testMaxSingleJobSize()
864883

865884
public function testMaxSingleJobsSizeOnProductReindex()
866885
{
886+
$this->markTestIncomplete(self::INCOMPLETE_REASON);
887+
867888
$this->resetConfigs([
868889
'algoliasearch_queue/queue/number_of_job_to_run',
869890
'algoliasearch_advanced/advanced/number_of_element_by_page',
@@ -887,6 +908,7 @@ public function testMaxSingleJobsSizeOnProductReindex()
887908
$lastJob = end($dbJobs);
888909

889910
$this->assertEquals(100, (int) $firstJob['data_size']);
911+
890912
$this->assertEquals($this->assertValues->lastJobDataSize, (int) $lastJob['data_size']);
891913
}
892914
}

0 commit comments

Comments
 (0)