ng e2e: selenium-webdriver crashes
Versions
λ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.7.3
Node: 8.9.4
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 5.2.4
@angular/cli: 1.7.3
@angular/material: 5.2.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
Repro steps
In a project with ~500 e2e tests: ng e2e or ng e2e --no-serve or protractor protractor.conf.js
Observed behavior
For about 5-10 minutes all tests are green. Suddenly, all following tests fail with this error:
fahrt/fahrt-1256.e2e-spec.ts
× should display vmArt correctly formatted (ICE)
- Failed: Element taking too long to appear in the DOM
Wait timed out after 3503ms
Wait timed out after 3503ms
at D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2107:17
at ManagedPromise.invokeCallback_ (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:1366:14)
at TaskQueue.execute_ (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2970:14)
at TaskQueue.executeNext_ (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2953:27)
at asyncRun (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2813:27)
at D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:676:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: Element taking too long to appear in the DOM
at scheduleWait (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2094:20)
at ControlFlow.wait (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:2408:12)
at Driver.wait (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\webdriver.js:943:29)
at run (D:\devsbb\workspaces\miku\miku-frontend\node_modules\protractor\lib\browser.ts:66:27)
at ProtractorBrowser.to.(anonymous function) [as wait] (D:\devsbb\workspaces\miku\miku-frontend\node_modules\protractor\lib\browser.ts:74:12)
at FahrtPage.CommonPage.waitForElement (D:\devsbb\workspaces\miku\miku-frontend\e2e\common.po.ts:17:13)
at FahrtPage.CommonPage.vmArtIcon (D:\devsbb\workspaces\miku\miku-frontend\e2e\common.po.ts:75:10)
at UserContext.<anonymous> (D:\devsbb\workspaces\miku\miku-frontend\e2e\fahrt\fahrt-1256.e2e-spec.ts:28:17)
at new ManagedPromise (D:\devsbb\workspaces\miku\miku-frontend\node_modules\selenium-webdriver\lib\promise.js:1067:7)
From: Task: Run it("should display vmArt correctly formatted (ICE)") in control flow
From asynchronous test:
Error
at Suite.<anonymous> (D:\devsbb\workspaces\miku\miku-frontend\e2e\fahrt\fahrt-1256.e2e-spec.ts:27:3)
at Object.<anonymous> (D:\devsbb\workspaces\miku\miku-frontend\e2e\fahrt\fahrt-1256.e2e-spec.ts:10:1)
at Module._compile (module.js:643:30)
at Module.m._compile (D:\devsbb\workspaces\miku\miku-frontend\node_modules\ts-node\src\index.ts:422:23)
at Module._extensions..js (module.js:654:10)
at Object.require.extensions.(anonymous function) [as .ts] (D:\devsbb\workspaces\miku\miku-frontend\node_modules\ts-node\src\index.ts:425:12)
I noticed a debug log is being generated with this content:
[0417/141205.241:ERROR:process_reader_win.cc(123)] NtOpenThread: {Zugriff verweigert} Ein Prozess hat einen Zugriff auf ein Objekt angefordert, aber ihm wurden nicht die Rechte f�r den Zugriff erteilt. (0xc0000022)
[0417/141205.245:ERROR:exception_snapshot_win.cc(88)] thread ID 17972 not found in process
[0417/141205.245:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0417/141427.340:ERROR:process_reader_win.cc(123)] NtOpenThread: {Zugriff verweigert} Ein Prozess hat einen Zugriff auf ein Objekt angefordert, aber ihm wurden nicht die Rechte f�r den Zugriff erteilt. (0xc0000022)
[0417/141427.342:ERROR:exception_snapshot_win.cc(88)] thread ID 6056 not found in process
[0417/141427.342:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0417/145223.585:ERROR:process_reader_win.cc(123)] NtOpenThread: {Zugriff verweigert} Ein Prozess hat einen Zugriff auf ein Objekt angefordert, aber ihm wurden nicht die Rechte f�r den Zugriff erteilt. (0xc0000022)
[0417/145223.588:ERROR:exception_snapshot_win.cc(88)] thread ID 15032 not found in process
[0417/145223.588:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0417/145223.590:ERROR:process_reader_win.cc(123)] NtOpenThread: {Zugriff verweigert} Ein Prozess hat einen Zugriff auf ein Objekt angefordert, aber ihm wurden nicht die Rechte f�r den Zugriff erteilt. (0xc0000022)
[0417/145223.591:ERROR:exception_snapshot_win.cc(88)] thread ID 14224 not found in process
[0417/145223.591:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
[0418/074148.652:ERROR:process_reader_win.cc(123)] NtOpenThread: {Zugriff verweigert} Ein Prozess hat einen Zugriff auf ein Objekt angefordert, aber ihm wurden nicht die Rechte f�r den Zugriff erteilt. (0xc0000022)
[0418/074148.654:ERROR:exception_snapshot_win.cc(88)] thread ID 12712 not found in process
[0418/074148.654:WARNING:crash_report_exception_handler.cc(62)] ProcessSnapshotWin::Initialize failed
Re-running the failed tests with protractor works. But since ~250 tests are failing, I can't run them all manually.
Desired behavior
ng e2e runs all tests
Mention any other details that might be useful (optional)
Chrome Version 65.0.3325.181
edit: This used to work some time ago. Might have to do with new versions of chrome.
So, I found the problem. While whatching the e2e tests executing, I noticed undesired browser refreshes related to this piece of code:
this.platformLocation.onPopState(() => {
// for device back button (android): on home, re-init app.
if (this.isHome()) {
const historyLength = history.length;
history.go(-historyLength);
this.windowRefService.nativeWindow.location.replace('/');
}
});
Removing the location.replace solved it.
This issue can be closed, it's not related to angular-cli or selenium (although selenium should still not crash even with this code).
Thanks for sharing!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.