@applitools/eyes-storybook 3.53.8 → 3.53.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/package.json +4 -4
- package/src/pagePool.js +34 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.53.9](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.53.8...js/eyes-storybook@3.53.9) (2025-02-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* page pool hang ([#2803](https://github.com/Applitools-Dev/sdk/issues/2803)) ([249043a](https://github.com/Applitools-Dev/sdk/commit/249043a4a31b358cbc3a06728d0fc493156d3c83))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/ufg-client bumped to 1.16.5
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* fix offline - url was replaced before resource fetched for url resources ([#2802](https://github.com/Applitools-Dev/sdk/issues/2802)) ([a67f86a](https://github.com/Applitools-Dev/sdk/commit/a67f86aabd56c59fb6cfa58578b1e8b3c31d2197))
|
|
17
|
+
* @applitools/core bumped to 4.31.3
|
|
18
|
+
#### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* fix offline - url was replaced before resource fetched for url resources ([#2802](https://github.com/Applitools-Dev/sdk/issues/2802)) ([a67f86a](https://github.com/Applitools-Dev/sdk/commit/a67f86aabd56c59fb6cfa58578b1e8b3c31d2197))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
* @applitools/eyes bumped to 1.32.2
|
|
25
|
+
|
|
26
|
+
|
|
3
27
|
## [3.53.8](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.53.7...js/eyes-storybook@3.53.8) (2025-02-11)
|
|
4
28
|
|
|
5
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-storybook",
|
|
3
|
-
"version": "3.53.
|
|
3
|
+
"version": "3.53.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"up:framework": "cd test/fixtures/storybook-versions/${APPLITOOLS_FRAMEWORK_VERSION} && npm ci"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@applitools/core": "4.31.
|
|
56
|
+
"@applitools/core": "4.31.3",
|
|
57
57
|
"@applitools/driver": "1.20.4",
|
|
58
|
-
"@applitools/eyes": "1.32.
|
|
58
|
+
"@applitools/eyes": "1.32.2",
|
|
59
59
|
"@applitools/functional-commons": "1.6.0",
|
|
60
60
|
"@applitools/logger": "2.1.0",
|
|
61
61
|
"@applitools/monitoring-commons": "1.0.19",
|
|
62
62
|
"@applitools/spec-driver-puppeteer": "1.4.24",
|
|
63
|
-
"@applitools/ufg-client": "1.16.
|
|
63
|
+
"@applitools/ufg-client": "1.16.5",
|
|
64
64
|
"@applitools/utils": "1.7.7",
|
|
65
65
|
"boxen": "4.2.0",
|
|
66
66
|
"chalk": "3.0.0",
|
package/src/pagePool.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function createPagePool({initPage, logger}) {
|
|
3
|
+
function createPagePool({initPage, logger, freePageTimeout = 300_000}) {
|
|
4
4
|
let counter = 0;
|
|
5
5
|
const fullPageObjs = [];
|
|
6
6
|
logger.log(`[page pool] created`);
|
|
@@ -48,22 +48,38 @@ function createPagePool({initPage, logger}) {
|
|
|
48
48
|
pagePool.addToPool(newPageId);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
async function getFreePage() {
|
|
52
|
-
logger.log(`[page pool] waiting for free page`);
|
|
51
|
+
async function getFreePage(tryCount = 0) {
|
|
52
|
+
logger.log(`[page pool] waiting for free page, tryCount=${tryCount}`);
|
|
53
53
|
await currWaitOnFreePage;
|
|
54
|
+
const availablePages = fullPageObjs.filter(p => p.isInPool());
|
|
55
|
+
// wait up to 5 minutes
|
|
56
|
+
if (availablePages.length === 0) {
|
|
57
|
+
const INTERVAL = 500;
|
|
58
|
+
if (tryCount < freePageTimeout / INTERVAL) {
|
|
59
|
+
logger.log(`[page pool] no available pages, retrying to get free page...`);
|
|
60
|
+
await new Promise(r => setTimeout(r, INTERVAL));
|
|
61
|
+
return getFreePage(tryCount + 1);
|
|
62
|
+
} else {
|
|
63
|
+
throw new Error('Could not find free page, timed out after waiting 5 minutes');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
logger.log(`[page pool] waiting on pages ${availablePages.map(({pageId}) => pageId)}`);
|
|
54
67
|
currWaitOnFreePage = Promise.race(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return p;
|
|
60
|
-
}),
|
|
68
|
+
availablePages.map(async p => {
|
|
69
|
+
await p.waitUntilFree();
|
|
70
|
+
return p;
|
|
71
|
+
}),
|
|
61
72
|
);
|
|
62
73
|
|
|
63
74
|
const fullPageObj = await currWaitOnFreePage;
|
|
64
|
-
fullPageObj.
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
if (fullPageObj.isInPool()) {
|
|
76
|
+
fullPageObj.occupyPage();
|
|
77
|
+
logger.log(`[page pool] free page found: ${fullPageObj.pageId}`);
|
|
78
|
+
return toSmallPageObj(fullPageObj);
|
|
79
|
+
} else {
|
|
80
|
+
logger.log(`[page pool] free page found, but it is no longer in pool: ${fullPageObj.pageId}`);
|
|
81
|
+
return getFreePage(tryCount + 1);
|
|
82
|
+
}
|
|
67
83
|
}
|
|
68
84
|
|
|
69
85
|
async function createPage() {
|
|
@@ -91,7 +107,9 @@ function createPagePool({initPage, logger}) {
|
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
async function waitUntilFree() {
|
|
110
|
+
logger.log(`[page ${pageId}] waitUntilFree before`);
|
|
94
111
|
await workPromise;
|
|
112
|
+
logger.log(`[page ${pageId}] waitUntilFree after`);
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
function occupyPage() {
|
|
@@ -101,10 +119,13 @@ function createPagePool({initPage, logger}) {
|
|
|
101
119
|
}
|
|
102
120
|
|
|
103
121
|
function removePage() {
|
|
122
|
+
logger.log(`[page ${pageId}] removePage`);
|
|
104
123
|
fullPageObjs.splice(
|
|
105
124
|
fullPageObjs.findIndex(p => p.pageId === pageId),
|
|
106
125
|
1,
|
|
107
126
|
);
|
|
127
|
+
isActive = false;
|
|
128
|
+
resolveWork && resolveWork();
|
|
108
129
|
}
|
|
109
130
|
|
|
110
131
|
function isInPool() {
|
|
@@ -112,6 +133,7 @@ function createPagePool({initPage, logger}) {
|
|
|
112
133
|
}
|
|
113
134
|
|
|
114
135
|
function addToPool() {
|
|
136
|
+
logger.log(`[page ${pageId}] addToPool`);
|
|
115
137
|
isActive = true;
|
|
116
138
|
createdAt = Date.now();
|
|
117
139
|
}
|