Page MenuHomePhabricator

Error running Selenium tests in fresh-node in mediawiki core
Closed, ResolvedPublic

Description

Attempting to run Selenium tests in mediawiki core using the instructions provided by DEVELOPERS.md, but receiving ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444. I am using Ubuntu 20.04.1 LTS, 64-bit. Full error message at P13721.

Steps to Reproduce

  1. Download Mediawiki core using:
git clone ssh://<USERNAME>@gerrit.wikimedia.org:29418/mediawiki/core.git mediawiki
  1. Install docker and docker-compose
  2. Start the environment:
# -d is detached mode - runs containers in the background:
docker-compose up -d

Install Composer dependencies:

docker-compose exec mediawiki composer update

Install MediaWiki in the environment:

docker-compose exec mediawiki /bin/bash /docker/install.sh
  1. Set environment variables, run fresh-node, npm ci, and selenium test
export MW_SERVER=http://localhost:8080
export MW_SCRIPT_PATH=/w
export MEDIAWIKI_USER=Admin
export MEDIAWIKI_PASSWORD=dockerpass
fresh-node -env -net
npm ci
npm run selenium-test

Expected Results:
Run selenium tests without error.

Actual Results:

1jaredblumer@jdot:~/Desktop/mediawiki$ fresh-node -env -net
2# fresh: 20.08.1 (2020-08-27)
3# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
4# software: Debian GNU/Linux 9 (stretch)
5# Node.js v10.15.2 (npm 6.14.5)
6# Chromium 71.0.3578.80
7# Mozilla Firefox 68.11.0esr
8# JSDuck 5.3.4 (Ruby 2.3.3)
9# mount: /mediawiki ➟ /home/jaredblumer/Desktop/mediawiki (read-write)
10# /mediawiki/.git ➟ /home/jaredblumer/Desktop/mediawiki/.git (read-only)
11# env: MW_*, MEDIAWIKI_*
12# net: expose host
13
14🌱 Fresh!
15
16I have no name!@jdot:/mediawiki$ npm ci
17npm WARN prepare removing existing node_modules/ before installation
18
19> @ffmpeg-installer/darwin-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/darwin-x64
20> chmod u+x ffmpeg
21
22
23> @ffmpeg-installer/linux-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-x64
24> chmod u+x ffmpeg
25
26
27> @ffmpeg-installer/linux-ia32@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-ia32
28> chmod u+x ffmpeg
29
30
31> @ffmpeg-installer/linux-arm64@4.1.4 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm64
32> chmod u+x ffmpeg
33
34
35> @ffmpeg-installer/linux-arm@4.1.3 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm
36> chmod u+x ffmpeg
37
38
39> fibers@4.0.3 install /mediawiki/node_modules/fibers
40> node build.js || nodejs build.js
41
42`linux-x64-64-glibc` exists; testing
43Binary is fine; exiting
44
45> sauce-connect-launcher-update@1.3.2 postinstall /mediawiki/node_modules/sauce-connect-launcher-update
46> node scripts/install.js || nodejs scripts/install.js
47
48
49> core-js@3.6.5 postinstall /mediawiki/node_modules/core-js
50> node -e "try{require('./postinstall')}catch(e){}"
51
52Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
53
54The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
55> https://opencollective.com/core-js
56> https://www.patreon.com/zloirock
57
58Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
59
60added 1550 packages in 175.413s
61I have no name!@jdot:/mediawiki$ npm run selenium
62npm ERR! missing script: selenium
63
64npm ERR! A complete log of this run can be found in:
65npm ERR! /cache/_logs/2021-01-12T00_32_14_739Z-debug.log
66I have no name!@jdot:/mediawiki$ npm run selenium-test
67
68> @ selenium-test /mediawiki
69> wdio ./tests/selenium/wdio.conf.js
70
71
72Execution of 6 spec files started at 2021-01-12T00:32:27.688Z
73
74(node:85) ExperimentalWarning: The dns.promises API is experimental
75(node:85) ExperimentalWarning: The fs.promises API is experimental
76[0-0] (node:94) ExperimentalWarning: The dns.promises API is experimental
77[0-0] (node:94) ExperimentalWarning: The fs.promises API is experimental
78[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
79[0-0] (node:94) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
80[0-0] 2021-01-12T00:32:29.287Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
81 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
82 at Object.onceWrapper (events.js:277:13)
83 at ClientRequest.emit (events.js:194:15)
84 at ClientRequest.EventEmitter.emit (domain.js:441:20)
85 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
86 at Socket.socketErrorListener (_http_client.js:392:9)
87 at Socket.emit (events.js:189:13)
88 at Socket.EventEmitter.emit (domain.js:441:20)
89 at emitErrorNT (internal/streams/destroy.js:82:8)
90 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
91 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
92[0-0] 2021-01-12T00:32:29.289Z ERROR @wdio/runner: Error: Failed to create session.
93Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
94If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
95 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
96 at process._tickCallback (internal/process/next_tick.js:68:7)
97[0-0] Error: Failed to create session.
98Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
99If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
100[0-0] 2021-01-12T00:32:34.303Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
101 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
102 at ontimeout (timers.js:436:11)
103 at tryOnTimeout (timers.js:300:5)
104 at listOnTimeout (timers.js:263:5)
105 at Timer.processTimers (timers.js:223:10)
106[0-0] FAILED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
107[0-1] (node:107) ExperimentalWarning: The dns.promises API is experimental
108[0-1] (node:107) ExperimentalWarning: The fs.promises API is experimental
109[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
110[0-1] (node:107) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
111[0-1] 2021-01-12T00:32:36.292Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
112 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
113 at Object.onceWrapper (events.js:277:13)
114 at ClientRequest.emit (events.js:194:15)
115 at ClientRequest.EventEmitter.emit (domain.js:441:20)
116 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
117 at Socket.socketErrorListener (_http_client.js:392:9)
118 at Socket.emit (events.js:189:13)
119 at Socket.EventEmitter.emit (domain.js:441:20)
120 at emitErrorNT (internal/streams/destroy.js:82:8)
121 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
122 at process._tickCallback (internal/process/next_tick.js:63:19)
123 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
1242021-01-12T00:32:36.295Z ERROR @wdio/runner: Error: Failed to create session.
125Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
126If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
127 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
128 at process._tickCallback (internal/process/next_tick.js:68:7)
129[0-1] Error: Failed to create session.
130Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
131If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
132[0-1] 2021-01-12T00:32:41.310Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
133 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
134 at ontimeout (timers.js:436:11)
135 at tryOnTimeout (timers.js:300:5)
136 at listOnTimeout (timers.js:263:5)
137 at Timer.processTimers (timers.js:223:10)
138[0-1] FAILED in chrome - /tests/selenium/specs/page.js
139[0-2] (node:120) ExperimentalWarning: The dns.promises API is experimental
140[0-2] (node:120) ExperimentalWarning: The fs.promises API is experimental
141[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
142[0-2] (node:120) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
143[0-2] 2021-01-12T00:32:43.214Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
144 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
145 at Object.onceWrapper (events.js:277:13)
146 at ClientRequest.emit (events.js:194:15)
147 at ClientRequest.EventEmitter.emit (domain.js:441:20)
148 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
149 at Socket.socketErrorListener (_http_client.js:392:9)
150 at Socket.emit (events.js:189:13)
151 at Socket.EventEmitter.emit (domain.js:441:20)
152 at emitErrorNT (internal/streams/destroy.js:82:8)
153 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
154 at process._tickCallback (internal/process/next_tick.js:63:19)
155 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
1562021-01-12T00:32:43.217Z ERROR @wdio/runner: Error: Failed to create session.
157Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
158If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
159 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
160 at process._tickCallback (internal/process/next_tick.js:68:7)
161[0-2] Error: Failed to create session.
162Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
163If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
164[0-2] 2021-01-12T00:32:48.230Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
165 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
166 at ontimeout (timers.js:436:11)
167 at tryOnTimeout (timers.js:300:5)
168 at listOnTimeout (timers.js:263:5)
169 at Timer.processTimers (timers.js:223:10)
170[0-2] FAILED in chrome - /tests/selenium/specs/rollback.js
171[0-3] (node:133) ExperimentalWarning: The dns.promises API is experimental
172[0-3] (node:133) ExperimentalWarning: The fs.promises API is experimental
173[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
174[0-3] (node:133) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
175[0-3] 2021-01-12T00:32:50.088Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
176 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
177 at Object.onceWrapper (events.js:277:13)
178 at ClientRequest.emit (events.js:194:15)
179 at ClientRequest.EventEmitter.emit (domain.js:441:20)
180 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
181 at Socket.socketErrorListener (_http_client.js:392:9)
182 at Socket.emit (events.js:189:13)
183 at Socket.EventEmitter.emit (domain.js:441:20)
184 at emitErrorNT (internal/streams/destroy.js:82:8)
185 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
186 at process._tickCallback (internal/process/next_tick.js:63:19)
187 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
188[0-3] 2021-01-12T00:32:50.090Z ERROR @wdio/runner: Error: Failed to create session.
189Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
190If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
191 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
192 at process._tickCallback (internal/process/next_tick.js:68:7)
193[0-3] Error: Failed to create session.
194Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
195If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
196[0-3] 2021-01-12T00:32:55.104Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
197 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
198 at ontimeout (timers.js:436:11)
199 at tryOnTimeout (timers.js:300:5)
200 at listOnTimeout (timers.js:263:5)
201 at Timer.processTimers (timers.js:223:10)
202[0-3] FAILED in chrome - /tests/selenium/specs/specialrecentchanges.js
203[0-4] (node:146) ExperimentalWarning: The dns.promises API is experimental
204[0-4] (node:146) ExperimentalWarning: The fs.promises API is experimental
205[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
206[0-4] (node:146) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
207[0-4] 2021-01-12T00:32:56.846Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
208 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
209 at Object.onceWrapper (events.js:277:13)
210 at ClientRequest.emit (events.js:194:15)
211 at ClientRequest.EventEmitter.emit (domain.js:441:20)
212 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
213 at Socket.socketErrorListener (_http_client.js:392:9)
214 at Socket.emit (events.js:189:13)
215 at Socket.EventEmitter.emit (domain.js:441:20)
216 at emitErrorNT (internal/streams/destroy.js:82:8)
217 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
218 at process._tickCallback (internal/process/next_tick.js:63:19)
219 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
220[0-4] 2021-01-12T00:32:56.849Z ERROR @wdio/runner: Error: Failed to create session.
221Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
222If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
223 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
224 at process._tickCallback (internal/process/next_tick.js:68:7)
225[0-4] Error: Failed to create session.
226Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
227If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
228[0-4] 2021-01-12T00:33:01.866Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
229 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
230 at ontimeout (timers.js:436:11)
231 at tryOnTimeout (timers.js:300:5)
232 at listOnTimeout (timers.js:263:5)
233 at Timer.processTimers (timers.js:223:10)
234[0-4] FAILED in chrome - /tests/selenium/specs/specialwatchlist.js
235[0-5] (node:159) ExperimentalWarning: The dns.promises API is experimental
236[0-5] (node:159) ExperimentalWarning: The fs.promises API is experimental
237[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
238[0-5] (node:159) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
239[0-5] 2021-01-12T00:33:03.614Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
240 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:940:25)
241 at Object.onceWrapper (events.js:277:13)
242 at ClientRequest.emit (events.js:194:15)
243 at ClientRequest.EventEmitter.emit (domain.js:441:20)
244 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
245 at Socket.socketErrorListener (_http_client.js:392:9)
246 at Socket.emit (events.js:189:13)
247 at Socket.EventEmitter.emit (domain.js:441:20)
248 at emitErrorNT (internal/streams/destroy.js:82:8)
249 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
250 at process._tickCallback (internal/process/next_tick.js:63:19)
251 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
252[0-5] 2021-01-12T00:33:03.616Z ERROR @wdio/runner: Error: Failed to create session.
253Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
254If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
255 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
256 at process._tickCallback (internal/process/next_tick.js:68:7)
257[0-5] Error: Failed to create session.
258Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
259If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
260[0-5] 2021-01-12T00:33:08.632Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
261 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
262 at ontimeout (timers.js:436:11)
263 at tryOnTimeout (timers.js:300:5)
264 at listOnTimeout (timers.js:263:5)
265 at Timer.processTimers (timers.js:223:10)
266[0-5] FAILED in chrome - /tests/selenium/specs/user.js
267
268Spec Files: 0 passed, 6 failed, 6 total (100% completed) in 00:00:40
269
270npm ERR! code ELIFECYCLE
271npm ERR! errno 1
272npm ERR! @ selenium-test: `wdio ./tests/selenium/wdio.conf.js`
273npm ERR! Exit status 1
274npm ERR!
275npm ERR! Failed at the @ selenium-test script.
276npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
277
278npm ERR! A complete log of this run can be found in:
279npm ERR! /cache/_logs/2021-01-12T00_33_08_916Z-debug.log

Event Timeline

jaredblumer renamed this task from Error running Selenium tests in fresh-node to Error running Selenium tests in fresh-node in mediawiki core.Jan 12 2021, 12:37 AM
jaredblumer updated the task description. (Show Details)

@jaredblumer I think I know what the problem is. selenium NPM script is removed, but the documentation wasn't updated. 🤦‍♂️

From your terminal output:

...
I have no name!@jdot:/mediawiki$ npm run selenium
	npm ERR! missing script: selenium
...

The script was removed last month in 650226.

I'll update the documentation (at Selenium/How-to/Run tests targeting MediaWiki-Docker using Fresh).

Step #1, reproduced the error:

nobody@e7208c76e29e:/core$ npm run selenium
npm ERR! missing script: selenium

npm ERR! A complete log of this run can be found in:
npm ERR!     /cache/_logs/2021-01-12T18_58_34_344Z-debug.log

Thanks for looking into this, Zeljko! As you can see in https://phabricator.wikimedia.org/P13721 beneath the command above, I saw that 'npm run selenium' was an invalid script, so I found the proper 'selenium-test' script in the package.json and tried running that, resulting in the error that I described in this issue. If you take another look you'll see that the error in question is resulting from the command 'npm run selenium-test'.

@jaredblumer I stopped at the first error 🤦‍♂️ I've tried updating the docs and got to the same place as you, selenium-test script failing. It was too late in my day so I gave up. I'll continue today.

I'm not sure what is wrong. 🤔 @Krinkle, do you know what is the problem?

I'm following updated instructions at Selenium/How-to/Run tests targeting MediaWiki-Docker using Fresh

1nobody@d106eda925b5:/core$ chromedriver --url-base=wd/hub --port=4444 &
2[1] 64
3nobody@d106eda925b5:/core$ Starting ChromeDriver 71.0.3578.80 on port 4444
4Only local connections are allowed.
5[1610565009.504][SEVERE]: bind() returned an error, errno=99: Cannot assign requested address (99)
6
7nobody@d106eda925b5:/core$ npm run selenium-test
8
9> @ selenium-test /core
10> wdio ./tests/selenium/wdio.conf.js
11
12
13Execution of 6 spec files started at 2021-01-13T19:13:07.235Z
14
15(node:81) ExperimentalWarning: The dns.promises API is experimental
16(node:81) ExperimentalWarning: The fs.promises API is experimental
17[0-0] (node:90) ExperimentalWarning: The dns.promises API is experimental
18[0-0] (node:90) ExperimentalWarning: The fs.promises API is experimental
19[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
20[0-0] (node:90) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
21[0-0] (node:90) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
22[0-0]
23 Screenshot location: /core/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
24
25[0-0] Error in "BlankPage should have its title @daily"
26Can't call getText on element with selector ".firstHeading" because element wasn't found
27[0-0] FAILED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
28[0-1] (node:177) ExperimentalWarning: The dns.promises API is experimental
29[0-1] (node:177) ExperimentalWarning: The fs.promises API is experimental
30[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
31[0-1] (node:177) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
32[0-1] (node:177) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
33[0-1] Error in "Page "before all" hook for "should be previewable""
34connect ECONNREFUSED 127.0.0.1:8080
35[0-1] FAILED in chrome - /tests/selenium/specs/page.js
36[0-2] (node:233) ExperimentalWarning: The dns.promises API is experimental
37[0-2] (node:233) ExperimentalWarning: The fs.promises API is experimental
38[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
39[0-2] (node:233) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
40[0-2] (node:233) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
41[0-2] Error in "Rollback with confirmation "before all" hook for "should offer rollback options for admin users""
42Can't call setValue on element with selector "#wpName1" because element wasn't found
43[0-2] Error in "Rollback without confirmation "before all" hook for "should perform rollback via POST request without asking the user to confirm""
44Can't call setValue on element with selector "#wpName1" because element wasn't found
45[0-2] FAILED in chrome - /tests/selenium/specs/rollback.js
46[0-3] (node:310) ExperimentalWarning: The dns.promises API is experimental
47[0-3] (node:310) ExperimentalWarning: The fs.promises API is experimental
48[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
49[0-3] (node:310) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
50[0-3] (node:310) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
51[0-3] Error in "Special:RecentChanges "before all" hook for "shows page creation""
52connect ECONNREFUSED 127.0.0.1:8080
53[0-3] FAILED in chrome - /tests/selenium/specs/specialrecentchanges.js
54[0-4] (node:366) ExperimentalWarning: The dns.promises API is experimental
55[0-4] (node:366) ExperimentalWarning: The fs.promises API is experimental
56[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
57[0-4] (node:366) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
58[0-4] (node:366) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
59[0-4] Error in "Special:Watchlist "before all" hook for "should show page with new edit""
60connect ECONNREFUSED 127.0.0.1:8080
61[0-4] FAILED in chrome - /tests/selenium/specs/specialwatchlist.js
62[0-5] (node:422) ExperimentalWarning: The dns.promises API is experimental
63[0-5] (node:422) ExperimentalWarning: The fs.promises API is experimental
64[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
65[0-5] (node:422) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
66[0-5] (node:422) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
67[0-5] Error in "User "before all" hook for "should be able to create account""
68connect ECONNREFUSED 127.0.0.1:8080
69[0-5] FAILED in chrome - /tests/selenium/specs/user.js
70
71 "dot" Reporter:
72F
73
74Spec Files: 0 passed, 6 failed, 6 total (100% completed) in 00:01:00
75
76npm ERR! code ELIFECYCLE
77npm ERR! errno 1
78npm ERR! @ selenium-test: `wdio ./tests/selenium/wdio.conf.js`
79npm ERR! Exit status 1
80npm ERR!
81npm ERR! Failed at the @ selenium-test script.
82npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
83
84npm ERR! A complete log of this run can be found in:
85npm ERR! /cache/_logs/2021-01-13T19_14_07_570Z-debug.log

The same images and infrastructure are used in CI, so overall it seems to still work. I'll take a look, to see if I can reproduce the issue and/or decude what might be causing this issue for you.

@Krinkle thanks! I'm not sure what the problem is. The tests fail with connect ECONNREFUSED 127.0.0.1:8080.

I'm not able to reproduce the issue. I tried both with MediaWiki-Docker and with my usual mediawiki-docker-dev setup:

1mediawiki-docker-dev$ ./create.sh
2
3# my .bashrc
4export MW_SERVER='http://default.web.mw.localhost:8080'
5export MW_SCRIPT_PATH='/mediawiki'
6export MEDIAWIKI_USER='Admin'
7export MEDIAWIKI_PASSWORD='dockerpass'
8
9mediawiki$ fresh-node -net -env
10# fresh: 20.08.1 (2020-08-27)
11# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
12# software: Debian GNU/Linux 9 (stretch)
13# Node.js v10.15.2 (npm 6.14.5)
14# Chromium 71.0.3578.80
15# Mozilla Firefox 68.11.0esr
16# JSDuck 5.3.4 (Ruby 2.3.3)
17# mount: /mediawiki ➟ /Users/krinkle/Development/mediawiki (read-write)
18# /mediawiki/.git ➟ /Users/krinkle/Development/mediawiki/.git (read-only)
19# env: MW_*, MEDIAWIKI_*
20# net: expose host
21
22🌱 Fresh!
23
24nobody@docker-desktop:/mediawiki$ npm ci
25…
26
27nobody@docker-desktop:/mediawiki$ chromedriver --url-base=wd/hub --port=4444 &
28[1] 7
29nobody@docker-desktop:/mediawiki$ Starting ChromeDriver 71.0.3578.80 on port 4444
30Only local connections are allowed.
31
32nobody@docker-desktop:/mediawiki$ npm run selenium-test
33
34> @ selenium-test /mediawiki
35> wdio ./tests/selenium/wdio.conf.js
36
37
38Execution of 6 spec files started at 2021-01-14T23:21:11.896Z
39
40[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
41[0-0]
42 Screenshot location: /mediawiki/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
43
44[0-0] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js

1# Install as per https://gerrit.wikimedia.org/g/mediawiki/core/+/master/DEVELOPERS.md
2mediawiki$ cat .env
3MW_DOCKER_PORT=4000
4MW_SCRIPT_PATH=/w
5MW_SERVER=http://localhost:4000
6MEDIAWIKI_USER=Admin
7MEDIAWIKI_PASSWORD=dockerpass
8XDEBUG_CONFIG=''
9
10mediawiki$ docker-composer
11… up …
12… composer …
13… install …
14
15mediawiki$ fresh-node -env -net
16# fresh: 20.08.1 (2020-08-27)
17# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
18# software: Debian GNU/Linux 9 (stretch)
19# Node.js v10.15.2 (npm 6.14.5)
20# Chromium 71.0.3578.80
21# Mozilla Firefox 68.11.0esr
22# JSDuck 5.3.4 (Ruby 2.3.3)
23# mount: /mediawiki ➟ /Users/krinkle/Development/mediawiki (read-write)
24# /mediawiki/.git ➟ /Users/krinkle/Development/mediawiki/.git (read-only)
25# env: MW_*, MEDIAWIKI_*
26# net: expose host
27
28🌱 Fresh!
29
30nobody@docker-desktop:/mediawiki$ npm ci
31…
32
33nobody@docker-desktop:/mediawiki$ chromedriver --url-base=wd/hub --port=4444 &
34[1] 7
35nobody@docker-desktop:/mediawiki$ Starting ChromeDriver 71.0.3578.80 on port 4444
36Only local connections are allowed.
37
38nobody@docker-desktop:/mediawiki$ npm run selenium-test
39
40> @ selenium-test /mediawiki
41> wdio ./tests/selenium/wdio.conf.js
42
43
44Execution of 6 spec files started at 2021-01-15T00:14:13.594Z
45
46[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
47[0-0]
48 Screenshot location: /mediawiki/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
49
50[0-0] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
51^C

@zeljkofilipin Based on the Wdio error, I suspect it is likely a networking issue. In other words, the browser is just seeing an empty browser tab.

The tests fail with connect ECONNREFUSED 127.0.0.1:8080.

Right, so this means your MediaWiki server isn't visible to the container.

Some things to check:

  • What do the screenshots and videos/frames look like? (Presumably just an empty tab, but with confirming)
  • Did you pass -env and -net?
  • What does running env | grep -E 'MW|MEDIAW' | sort inside Fresh return?
  • What do curl -I $MW_SERVER and curl -I $MW_SERVER/w/load.php return inside Fresh? Does it give more detail than ECONNREFUSED? Does it work if you run it outside of docker, from your primary shell?

It looks like this might be an issue with Docker for Linux where -net (which we map to docker run --network=host) might not correctly by default.

Try this patch and let me know if that works. According to some internet forums, one of these is meant to work on Ubuntu since Docker v20.04 (or Docker v20.10?):

bin/fresh-node Both
 	docker_args+=("--network" "host")
+	docker_args+=("--add-host=host.docker.internal:host-gateway")

Or

bin/fresh-node Instead
-	docker_args+=("--network" "host")
+	docker_args+=("--add-host=host.docker.internal:host-gateway")
This comment was removed by jaredblumer.
This comment was removed by jaredblumer.

I removed my previous comments as I believe I may have made a mistake when following @Krinkle's recommendations. I'll take a look again tomorrow and will share my results.

I ran the tests again using "chromedriver --url-base=wd/hub --port=4444 &" and passed only 3 of 6 tests. Do you have any insights as to why these 3 failed?

1jaredblumer@jdot:~/Desktop/mediawiki$ export MW_SERVER=http://localhost:8080/
2jaredblumer@jdot:~/Desktop/mediawiki$ export MW_SCRIPT_PATH=/w
3jaredblumer@jdot:~/Desktop/mediawiki$ export MEDIAWIKI_USER=Admin
4jaredblumer@jdot:~/Desktop/mediawiki$ export MEDIAWIKI_PASSWORD=dockerpass
5jaredblumer@jdot:~/Desktop/mediawiki$ fresh-node -env -net
6# fresh: 20.08.1 (2020-08-27)
7# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
8# software: Debian GNU/Linux 9 (stretch)
9# Node.js v10.15.2 (npm 6.14.5)
10# Chromium 71.0.3578.80
11# Mozilla Firefox 68.11.0esr
12# JSDuck 5.3.4 (Ruby 2.3.3)
13# mount: /mediawiki ➟ /home/jaredblumer/Desktop/mediawiki (read-write)
14# /mediawiki/.git ➟ /home/jaredblumer/Desktop/mediawiki/.git (read-only)
15# env: MW_*, MEDIAWIKI_*
16# net: expose host
17
18🌱 Fresh!
19
20I have no name!@jdot:/mediawiki$ npm ci
21npm WARN prepare removing existing node_modules/ before installation
22
23> @ffmpeg-installer/darwin-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/darwin-x64
24> chmod u+x ffmpeg
25
26
27> @ffmpeg-installer/linux-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-x64
28> chmod u+x ffmpeg
29
30
31> @ffmpeg-installer/linux-ia32@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-ia32
32> chmod u+x ffmpeg
33
34
35> @ffmpeg-installer/linux-arm64@4.1.4 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm64
36> chmod u+x ffmpeg
37
38
39> @ffmpeg-installer/linux-arm@4.1.3 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm
40> chmod u+x ffmpeg
41
42
43> fibers@4.0.3 install /mediawiki/node_modules/fibers
44> node build.js || nodejs build.js
45
46`linux-x64-64-glibc` exists; testing
47Binary is fine; exiting
48
49> sauce-connect-launcher-update@1.3.2 postinstall /mediawiki/node_modules/sauce-connect-launcher-update
50> node scripts/install.js || nodejs scripts/install.js
51
52
53> core-js@3.6.5 postinstall /mediawiki/node_modules/core-js
54> node -e "try{require('./postinstall')}catch(e){}"
55
56Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
57
58The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
59> https://opencollective.com/core-js
60> https://www.patreon.com/zloirock
61
62Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
63
64added 1550 packages in 53.333s
65I have no name!@jdot:/mediawiki$ chromedriver --url-base=wd/hub --port=4444 &
66[1] 63
67I have no name!@jdot:/mediawiki$ Starting ChromeDriver 71.0.3578.80 on port 4444
68Only local connections are allowed.
69npm run selenium-test
70
71> @ selenium-test /mediawiki
72> wdio ./tests/selenium/wdio.conf.js
73
74
75Execution of 6 spec files started at 2021-01-18T03:02:14.911Z
76
77(node:80) ExperimentalWarning: The dns.promises API is experimental
78(node:80) ExperimentalWarning: The fs.promises API is experimental
79[0-0] (node:89) ExperimentalWarning: The dns.promises API is experimental
80[0-0] (node:89) ExperimentalWarning: The fs.promises API is experimental
81[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
82[0-0] (node:89) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
83[0-0] (node:89) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
84[0-0]
85 Screenshot location: /mediawiki/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
86
87[0-0] Error in "BlankPage should have its title @daily"
88Can't call getText on element with selector ".firstHeading" because element wasn't found
89[0-0] FAILED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
90[0-1] (node:178) ExperimentalWarning: The dns.promises API is experimental
91[0-1] (node:178) ExperimentalWarning: The fs.promises API is experimental
92[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
93[0-1] (node:178) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
94[0-1] (node:178) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
95[0-1] [03:02:39] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
96[0-1]
97 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-previewable.png
98
99[0-1] Error in "Page should be previewable"
100Can't call getText on element with selector ".firstHeading" because element wasn't found
101[0-1]
102 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-creatable.png
103
104[0-1] Error in "Page should be creatable"
105Can't call getText on element with selector ".firstHeading" because element wasn't found
106[0-1]
107 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-re-creatable.png
108
109[0-1] Error in "Page should be re-creatable"
110Can't call getText on element with selector ".firstHeading" because element wasn't found
111[0-1]
112 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-editable-%40daily.png
113
114[0-1] Error in "Page should be editable @daily"
115Can't call getText on element with selector ".firstHeading" because element wasn't found
116[0-1]
117 Screenshot location: /mediawiki/tests/selenium/log/Page-should-have-history-%40daily.png
118
119[0-1]
120 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-deletable.png
121
122[0-1]
123 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-restorable.png
124
125[0-1]
126 Screenshot location: /mediawiki/tests/selenium/log/Page-should-be-undoable.png
127
128[0-1] FAILED in chrome - /tests/selenium/specs/page.js
129[0-2] (node:395) ExperimentalWarning: The dns.promises API is experimental
130[0-2] (node:395) ExperimentalWarning: The fs.promises API is experimental
131[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
132[0-2] (node:395) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
133[0-2] (node:395) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
134[0-2] PASSED in chrome - /tests/selenium/specs/rollback.js
135[0-3] (node:468) ExperimentalWarning: The dns.promises API is experimental
136[0-3] (node:468) ExperimentalWarning: The fs.promises API is experimental
137[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
138[0-3] (node:468) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
139[0-3] (node:468) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
140[0-3] [03:03:49] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
141[0-3]
142 Screenshot location: /mediawiki/tests/selenium/log/Special%3ARecentChanges-shows-page-creation.png
143
144[0-3] PASSED in chrome - /tests/selenium/specs/specialrecentchanges.js
145[0-4] (node:558) ExperimentalWarning: The dns.promises API is experimental
146[0-4] (node:558) ExperimentalWarning: The fs.promises API is experimental
147[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
148[0-4] (node:558) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
149[0-4] (node:558) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
150[0-4] [03:03:59] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
151[0-4]
152 Screenshot location: /mediawiki/tests/selenium/log/Special%3AWatchlist-should-show-page-with-new-edit.png
153
154[0-4] PASSED in chrome - /tests/selenium/specs/specialwatchlist.js
155[0-5] (node:653) ExperimentalWarning: The dns.promises API is experimental
156[0-5] (node:653) ExperimentalWarning: The fs.promises API is experimental
157[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
158[0-5] (node:653) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
159[0-5] (node:653) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time
160[0-5] [03:04:14] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
161[0-5]
162 Screenshot location: /mediawiki/tests/selenium/log/User-should-be-able-to-create-account.png
163
164[0-5] Error in "User should be able to create account"
165Can't call getText on element with selector ".firstHeading" because element wasn't found
166[0-5]
167 Screenshot location: /mediawiki/tests/selenium/log/User-should-be-able-to-log-in-%40daily.png
168
169[0-5] (node:653) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/mediawiki/tests/selenium/log/rawSeleniumVideoGrabs/User--should-be-able-to-log-in-daily--CHROME--01-18-2021--03-04-23-646/0007.png'
170 at Object.openSync (fs.js:439:3)
171 at Object.writeFileSync (fs.js:1190:35)
172 at Video.onTestEnd (/mediawiki/node_modules/wdio-video-reporter/dist/wdio-video-reporter.js:584:19)
173 at Video.WDIOReporter.on.test (/mediawiki/node_modules/wdio-video-reporter/node_modules/@wdio/reporter/build/index.js:132:12)
174 at reporters.forEach.reporter (/mediawiki/node_modules/@wdio/runner/build/reporter.js:38:49)
175 at Array.forEach (<anonymous>)
176 at BaseReporter.emit (/mediawiki/node_modules/@wdio/runner/build/reporter.js:38:20)
177 at MochaAdapter.emit (/mediawiki/node_modules/@wdio/mocha-framework/build/index.js:258:19)
178 at /mediawiki/node_modules/mocha/lib/runner.js:779:14
179 at done (/mediawiki/node_modules/mocha/lib/runnable.js:314:5)
180 at /mediawiki/node_modules/mocha/lib/runnable.js:379:11
181[0-5] (node:653) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
182(node:653) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
183[0-5] (node:653) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
184[0-5] FAILED in chrome - /tests/selenium/specs/user.js
185
186 "dot" Reporter:
187FFFFF............F..
188
189Spec Files: 3 passed, 3 failed, 6 total (100% completed) in 00:02:13
190
191npm ERR! code ELIFECYCLE
192npm ERR! errno 1
193npm ERR! @ selenium-test: `wdio ./tests/selenium/wdio.conf.js`
194npm ERR! Exit status 1
195npm ERR!
196npm ERR! Failed at the @ selenium-test script.
197npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
198
199npm ERR! A complete log of this run can be found in:
200npm ERR! /cache/_logs/2021-01-18T03_04_29_154Z-debug.log

I receive this error when attempting the "host-gateway" patch.

jaredblumer@jdot:~/Desktop/mediawiki$ fresh-node -env -net
docker: Error response from daemon: invalid IP address in add-host: "host-gateway".
See 'docker run --help'.

I ran the tests again using "chromedriver --url-base=wd/hub --port=4444 &" and passed only 3 of 6 tests. Do you have any insights as to why these 3 failed?

Error: ENOENT: no such file or directory, open '/mediawiki/tests/selenium/log/rawSeleniumVideoGrabs/User--should-be-able-to-log-in-daily--CHROME--01-18-2021--03-04-23-646/0007.png'
…
Spec Files:	 3 passed, 3 failed, 6 total (100% completed) in 00:02:13

If even a single test passes, then fortunately that means Docker or Fresh networking is working fine, so no patch needed. Were those 3 passing tests without any patch applied to fresh-node? If so, then you and Zeljko are experiecing two distinct issues. In any event, good to know that at least for you it seems Docker and Fresh -net work correctly on Ubuntu out of the box.

The above error means MediaWiki's webdriverio code was unable to create or add to the tests/selenium/log/ directory. This is likely a permission problem.

To confirm whether this is specific to webdriverio or a more general permission issue with the directory, try the following without any MW or selenium code:

you:mediawiki$ fresh-node -net -env

nobody@fresh:mediawiki$ mkdir -p tests/selenium/log/anewdir/
nobody@fresh:mediawiki$ touch tests/selenium/log/foo.txt

I receive this error when attempting the "host-gateway" patch.

jaredblumer@jdot:~/Desktop/mediawiki$ fresh-node -env -net
docker: Error response from daemon: invalid IP address in add-host: "host-gateway".
See 'docker run --help'.

What is the version returned by docker --version? (We're still on Ubuntu 20.04, right?)

I don't seem to have any problem with permissions in fresh-node. I was able to make a directory and create a file as you asked (code below). Any other ideas as to why I'm not passing all 6 selenium tests?

jaredblumer@jdot:~/Desktop/mediawiki$ fresh-node -env -net
# fresh: 20.08.1 (2020-08-27)
# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
# software: Debian GNU/Linux 9 (stretch)
#           Node.js v10.15.2 (npm 6.14.5)
#           Chromium 71.0.3578.80
#           Mozilla Firefox 68.11.0esr
#           JSDuck 5.3.4 (Ruby 2.3.3)
# mount: /mediawiki      ➟ /home/jaredblumer/Desktop/mediawiki      (read-write)
#        /mediawiki/.git ➟ /home/jaredblumer/Desktop/mediawiki/.git (read-only)
# env: MW_*, MEDIAWIKI_*
# net: expose host

🌱  Fresh!

I have no name!@jdot:/mediawiki$ mkdir -p tests/selenium/log/anewdir/
I have no name!@jdot:/mediawiki$ touch tests/selenium/log/foo.txt
I have no name!@jdot:/mediawiki$ ls tests/selenium/log/anewdir/
I have no name!@jdot:/mediawiki$ ls tests/selenium/log/
anewdir
...
foo.txt

What is the version returned by docker --version? (We're still on Ubuntu 20.04, right?)

My Docker version is 20.10.2, build 2291f61 and I am using Ubuntu 20.04.1 LTS.

  • Did you pass -env and -net?

No. 🤦‍♂️

I think @jaredblumer and I are having two completely separate problems. I've reported my problem as T272316: `fresh-node -env -net` not working on macOS 10.15.

Any other ideas as to why I'm not passing all 6 selenium tests?

Can you upload screenshots and videos that Selenium created in tests/selenium/log? (Make sure you delete the folder before the test run, so it's not populated with files from a previous run.)

Can you run the tests targeting mediawiki-docker without fresh? (Documentation: Selenium/Getting Started/Run tests targeting MediaWiki-Docker.)

I thought perhaps my issue was due to my Ubuntu Linux setup, so I attempted to run the same code on my iMac (macOS Catalina v 10.15.7) and received the same error

ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444

Any suggestions?

1jdot@Jared-Blumer mediawiki % export MW_SERVER=http://localhost:8080
2jdot@Jared-Blumer mediawiki % export MW_SCRIPT_PATH=/w
3jdot@Jared-Blumer mediawiki % export MEDIAWIKI_USER=Admin
4jdot@Jared-Blumer mediawiki % export MEDIAWIKI_PASSWORD=dockerpass
5jdot@Jared-Blumer mediawiki % fresh-node -env -net
6Unable to find image 'docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2' locally
70.6.2: Pulling from releng/node10-test-browser
8f4950aafeb34: Pull complete
9e78085bf0952: Pull complete
10939880aec332: Pull complete
11b2cf2bd19934: Pull complete
120ac698af5769: Pull complete
1319ad7020f7ad: Pull complete
1494f7dbe92000: Pull complete
159640099150ad: Pull complete
16968303af2151: Pull complete
173946aef5d4f6: Pull complete
18ffd325581505: Pull complete
19Digest: sha256:e1e890bf6c562e8e50439f374089d223845f2758f0a40ffa72d242629da6307a
20Status: Downloaded newer image for docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
21# fresh: 21.01.1 (2021-01-27)
22# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.2
23# software: Debian GNU/Linux 9 (stretch)
24# Node.js v10.15.2 (npm 6.14.5)
25# Chromium 71.0.3578.80
26# Mozilla Firefox 68.11.0esr
27# JSDuck 5.3.4 (Ruby 2.3.3)
28# mount: /mediawiki ➟ /Users/jdot/Desktop/mediawiki (read-write)
29# /mediawiki/.git ➟ /Users/jdot/Desktop/mediawiki/.git (read-only)
30# env: MW_*, MEDIAWIKI_*
31# net: expose host
32
33🌱 Fresh!
34
35nobody@docker-desktop:/mediawiki$ npm ci
36npm WARN prepare removing existing node_modules/ before installation
37
38> @ffmpeg-installer/darwin-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/darwin-x64
39> chmod u+x ffmpeg
40
41
42> @ffmpeg-installer/linux-x64@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-x64
43> chmod u+x ffmpeg
44
45
46> @ffmpeg-installer/linux-ia32@4.1.0 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-ia32
47> chmod u+x ffmpeg
48
49
50> @ffmpeg-installer/linux-arm64@4.1.4 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm64
51> chmod u+x ffmpeg
52
53
54> @ffmpeg-installer/linux-arm@4.1.3 postinstall /mediawiki/node_modules/@ffmpeg-installer/linux-arm
55> chmod u+x ffmpeg
56
57
58> core-js@3.6.5 postinstall /mediawiki/node_modules/core-js
59> node -e "try{require('./postinstall')}catch(e){}"
60
61Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
62
63The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
64> https://opencollective.com/core-js
65> https://www.patreon.com/zloirock
66
67Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
68
69
70> fibers@4.0.3 install /mediawiki/node_modules/fibers
71> node build.js || nodejs build.js
72
73`linux-x64-64-glibc` exists; testing
74Binary is fine; exiting
75
76> sauce-connect-launcher-update@1.3.2 postinstall /mediawiki/node_modules/sauce-connect-launcher-update
77> node scripts/install.js || nodejs scripts/install.js
78
79added 1574 packages in 287.239s
80nobody@docker-desktop:/mediawiki$ npm run selenium-test
81
82> @ selenium-test /mediawiki
83> wdio ./tests/selenium/wdio.conf.js
84
85
86Execution of 6 spec files started at 2021-03-01T00:36:43.012Z
87
88(node:130) ExperimentalWarning: The dns.promises API is experimental
89(node:130) ExperimentalWarning: The fs.promises API is experimental
90[0-0] (node:139) ExperimentalWarning: The dns.promises API is experimental
91[0-0] (node:139) ExperimentalWarning: The fs.promises API is experimental
92[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
93[0-0] (node:139) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
94[0-0] 2021-03-01T00:36:47.673Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
95 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
96 at Object.onceWrapper (events.js:277:13)
97 at ClientRequest.emit (events.js:194:15)
98 at ClientRequest.EventEmitter.emit (domain.js:441:20)
99 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
100 at Socket.socketErrorListener (_http_client.js:392:9)
101 at Socket.emit (events.js:189:13)
102 at Socket.EventEmitter.emit (domain.js:441:20)
103 at emitErrorNT (internal/streams/destroy.js:82:8)
104 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
105 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
106[0-0] 2021-03-01T00:36:47.675Z ERROR @wdio/runner: Error: Failed to create session.
107Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
108If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
109 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
110 at process._tickCallback (internal/process/next_tick.js:68:7)
111[0-0] Error: Failed to create session.
112Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
113If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
114[0-0] 2021-03-01T00:36:52.751Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
115 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
116 at ontimeout (timers.js:436:11)
117 at tryOnTimeout (timers.js:300:5)
118 at listOnTimeout (timers.js:263:5)
119 at Timer.processTimers (timers.js:223:10)
120[0-0] FAILED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
121[0-1] (node:152) ExperimentalWarning: The dns.promises API is experimental
122[0-1] (node:152) ExperimentalWarning: The fs.promises API is experimental
123[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
124[0-1] (node:152) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
125[0-1] 2021-03-01T00:36:58.907Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
126 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
127 at Object.onceWrapper (events.js:277:13)
128 at ClientRequest.emit (events.js:194:15)
129 at ClientRequest.EventEmitter.emit (domain.js:441:20)
130 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
131 at Socket.socketErrorListener (_http_client.js:392:9)
132 at Socket.emit (events.js:189:13)
133 at Socket.EventEmitter.emit (domain.js:441:20)
134 at emitErrorNT (internal/streams/destroy.js:82:8)
135 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
136 at process._tickCallback (internal/process/next_tick.js:63:19)
137 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
138[0-1] 2021-03-01T00:36:58.910Z ERROR @wdio/runner: Error: Failed to create session.
139Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
140If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
141 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
142 at process._tickCallback (internal/process/next_tick.js:68:7)
143[0-1] Error: Failed to create session.
144Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
145If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
146[0-1] 2021-03-01T00:37:03.923Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
147 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
148 at ontimeout (timers.js:436:11)
149 at tryOnTimeout (timers.js:300:5)
150 at listOnTimeout (timers.js:263:5)
151 at Timer.processTimers (timers.js:223:10)
152[0-1] FAILED in chrome - /tests/selenium/specs/page.js
153[0-2] (node:165) ExperimentalWarning: The dns.promises API is experimental
154[0-2] (node:165) ExperimentalWarning: The fs.promises API is experimental
155[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
156[0-2] (node:165) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
157[0-2] 2021-03-01T00:37:11.232Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
158 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
159 at Object.onceWrapper (events.js:277:13)
160 at ClientRequest.emit (events.js:194:15)
161 at ClientRequest.EventEmitter.emit (domain.js:441:20)
162 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
163 at Socket.socketErrorListener (_http_client.js:392:9)
164 at Socket.emit (events.js:189:13)
165 at Socket.EventEmitter.emit (domain.js:441:20)
166 at emitErrorNT (internal/streams/destroy.js:82:8)
167 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
168 at process._tickCallback (internal/process/next_tick.js:63:19)
169 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
170[0-2] 2021-03-01T00:37:11.240Z ERROR @wdio/runner: Error: Failed to create session.
171Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
172If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
173 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
174 at process._tickCallback (internal/process/next_tick.js:68:7)
175[0-2] Error: Failed to create session.
176Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
177If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
178[0-2] 2021-03-01T00:37:16.313Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
179 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
180 at ontimeout (timers.js:436:11)
181 at tryOnTimeout (timers.js:300:5)
182 at listOnTimeout (timers.js:263:5)
183 at Timer.processTimers (timers.js:223:10)
184[0-2] FAILED in chrome - /tests/selenium/specs/rollback.js
185[0-3] (node:178) ExperimentalWarning: The dns.promises API is experimental
186[0-3] (node:178) ExperimentalWarning: The fs.promises API is experimental
187[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
188[0-3] (node:178) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
189[0-3] 2021-03-01T00:37:22.984Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
190 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
191 at Object.onceWrapper (events.js:277:13)
192 at ClientRequest.emit (events.js:194:15)
193 at ClientRequest.EventEmitter.emit (domain.js:441:20)
194 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
195 at Socket.socketErrorListener (_http_client.js:392:9)
196 at Socket.emit (events.js:189:13)
197 at Socket.EventEmitter.emit (domain.js:441:20)
198 at emitErrorNT (internal/streams/destroy.js:82:8)
199 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
200 at process._tickCallback (internal/process/next_tick.js:63:19)
201 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
202[0-3] 2021-03-01T00:37:22.988Z ERROR @wdio/runner: Error: Failed to create session.
203Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
204If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
205 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
206 at process._tickCallback (internal/process/next_tick.js:68:7)
207[0-3] Error: Failed to create session.
208Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
209If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
210[0-3] 2021-03-01T00:37:28.071Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
211 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
212 at ontimeout (timers.js:436:11)
213 at tryOnTimeout (timers.js:300:5)
214 at listOnTimeout (timers.js:263:5)
215 at Timer.processTimers (timers.js:223:10)
216[0-3] FAILED in chrome - /tests/selenium/specs/specialrecentchanges.js
217[0-4] (node:191) ExperimentalWarning: The dns.promises API is experimental
218[0-4] (node:191) ExperimentalWarning: The fs.promises API is experimental
219[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
220[0-4] (node:191) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
221[0-4] 2021-03-01T00:37:34.163Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
222 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
223 at Object.onceWrapper (events.js:277:13)
224 at ClientRequest.emit (events.js:194:15)
225 at ClientRequest.EventEmitter.emit (domain.js:441:20)
226 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
227 at Socket.socketErrorListener (_http_client.js:392:9)
228 at Socket.emit (events.js:189:13)
229 at Socket.EventEmitter.emit (domain.js:441:20)
230 at emitErrorNT (internal/streams/destroy.js:82:8)
231 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
232 at process._tickCallback (internal/process/next_tick.js:63:19)
233 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
234[0-4] 2021-03-01T00:37:34.166Z ERROR @wdio/runner: Error: Failed to create session.
235Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
236If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
237 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
238 at process._tickCallback (internal/process/next_tick.js:68:7)
239[0-4] Error: Failed to create session.
240Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
241If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
242[0-4] 2021-03-01T00:37:39.229Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
243 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
244 at ontimeout (timers.js:436:11)
245 at tryOnTimeout (timers.js:300:5)
246 at listOnTimeout (timers.js:263:5)
247 at Timer.processTimers (timers.js:223:10)
248[0-4] FAILED in chrome - /tests/selenium/specs/specialwatchlist.js
249[0-5] (node:204) ExperimentalWarning: The dns.promises API is experimental
250[0-5] (node:204) ExperimentalWarning: The fs.promises API is experimental
251[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
252[0-5] (node:204) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
253[0-5] 2021-03-01T00:37:47.292Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:4444
254 at ClientRequest.request.once (/mediawiki/node_modules/got/dist/source/core/index.js:953:111)
255 at Object.onceWrapper (events.js:277:13)
256 at ClientRequest.emit (events.js:194:15)
257 at ClientRequest.EventEmitter.emit (domain.js:441:20)
258 at ClientRequest.origin.emit.args (/mediawiki/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
259 at Socket.socketErrorListener (_http_client.js:392:9)
260 at Socket.emit (events.js:189:13)
261 at Socket.EventEmitter.emit (domain.js:441:20)
262 at emitErrorNT (internal/streams/destroy.js:82:8)
263 at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
264 at process._tickCallback (internal/process/next_tick.js:63:19)
265 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
266[0-5] 2021-03-01T00:37:47.295Z ERROR @wdio/runner: Error: Failed to create session.
267Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
268If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
269 at startWebDriverSession (/mediawiki/node_modules/webdriver/build/utils.js:45:11)
270 at process._tickCallback (internal/process/next_tick.js:68:7)
271[0-5] Error: Failed to create session.
272Unable to connect to "http://127.0.0.1:4444/wd/hub", make sure browser driver is running on that address.
273If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
274[0-5] 2021-03-01T00:37:52.387Z ERROR @wdio/runner: Error: Some reporters are still unsynced: Video
275 at Timeout.setInterval (/mediawiki/node_modules/@wdio/runner/build/reporter.js:86:25)
276 at ontimeout (timers.js:436:11)
277 at tryOnTimeout (timers.js:300:5)
278 at listOnTimeout (timers.js:263:5)
279 at Timer.processTimers (timers.js:223:10)
280[0-5] FAILED in chrome - /tests/selenium/specs/user.js
281
282Spec Files: 0 passed, 6 failed, 6 total (100% completed) in 00:01:09
283
284npm ERR! code ELIFECYCLE
285npm ERR! errno 1
286npm ERR! @ selenium-test: `wdio ./tests/selenium/wdio.conf.js`
287npm ERR! Exit status 1
288npm ERR!
289npm ERR! Failed at the @ selenium-test script.
290npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
291
292npm ERR! A complete log of this run can be found in:
293npm ERR! /cache/_logs/2021-03-01T00_37_52_678Z-debug.log
294nobody@docker-desktop:/mediawiki$

• zeljkofilipin moved this task from Deep work 🌊 to Waiting 🏹 on the User-zeljkofilipin board.

@jaredblumer: I think I know what's the problem! I think you didn't start chromedriver. I've updated the instructions a few days ago. Take a look and let me know if something fails when you follow the instructions.

https://www.mediawiki.org/wiki/Selenium/How-to/Run_tests_targeting_MediaWiki-Docker_using_Fresh

@zeljkofilipin Thank you so much! Doing this alone passed three tests, then I realized I had to add the Vector skin for the other three to pass so we're all set. I'll close the task.