Skip to content

Commit a96d11b

Browse files
committed
pkp/pkp-lib#11637 refactor job processing mechanism for tests to handle server timeout
1 parent 18c8fc0 commit a96d11b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

cypress/support/e2e.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ import './commands';
1818

1919
require('cypress-failed-log');
2020

21+
// Rather than processing all pending jobs at the end of each test which may sometimes lead to timeouts
22+
// if there are a large number of time consuming jobs queued, we will process 3 before each test
23+
// and process 3 after each test and each of these 3 will be individually to minimize the chances of
24+
// server timeouts instead of one single long running process.
25+
beforeEach(function() {
26+
cy.runQueueJobs(null, false, true);
27+
cy.runQueueJobs(null, false, true);
28+
cy.runQueueJobs(null, false, true);
29+
});
30+
2131
afterEach(function() {
22-
cy.runQueueJobs();
32+
cy.runQueueJobs(null, false, true);
33+
cy.runQueueJobs(null, false, true);
34+
cy.runQueueJobs(null, false, true);
2335
});

0 commit comments

Comments
 (0)