This repository was archived by the owner on Oct 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed
tests/integration/Inventory Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -202,15 +202,24 @@ public function testQueryChannels()
202202 ->limit (1 );
203203 $ response = $ request ->executeWithClient ($ this ->getClient ());
204204 $ result = $ request ->mapResponse ($ response );
205- } while ($ result ->count () > 0 && $ retries <= 9 );
205+ } while ($ result ->count () == 0 && $ retries <= 20 );
206206
207- $ request = ProductProjectionSearchRequest::of ()
208- ->addFilterQuery (
209- Filter::ofName ('variants.availability.isOnStockInChannels ' )->setValue ([$ channel ->getId ()])
210- )
211- ->limit (1 );
212- $ response = $ request ->executeWithClient ($ this ->getClient ());
213- $ result = $ request ->mapResponse ($ response );
207+ if ($ result ->count () == 0 ) {
208+ $ this ->markTestSkipped ('Product availability not updated in time ' );
209+ }
210+
211+ $ retries = 0 ;
212+ do {
213+ $ retries ++;
214+ sleep (1 );
215+ $ request = ProductProjectionSearchRequest::of ()
216+ ->addFilterQuery (
217+ Filter::ofName ('variants.availability.isOnStockInChannels ' )->setValue ([$ channel ->getId ()])
218+ )
219+ ->limit (1 );
220+ $ response = $ request ->executeWithClient ($ this ->getClient ());
221+ $ result = $ request ->mapResponse ($ response );
222+ } while ($ result ->count () == 0 && $ retries <= 9 );
214223
215224 $ this ->assertSame (
216225 $ product ->getId (),
You can’t perform that action at this time.
0 commit comments