question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Macro Tasks left running after failed http requests with Unknown Error, preventing protractor from completing tests

See original GitHub issue

🐞 bug report

Affected Package

@angular/common/http

Is this a regression?

Yes. Worked in @angular/common@9.1.12

Description

A macroTask is left running when certain http errors occur and this prevents protractor for completing since there are tasks left running in the ngZone.

🔬 Minimal Reproduction

https://github.com/wfairclough/AngularHttpMacroTaskMinimalReproduction

Run npm install

Run with npx ng serve

Open Chrome Browser to http://localhost:4200

Reproduce Bug

  1. Click Button Make Successful Request and see successul response.
  2. Click Button Check Task Counts and see the open micro and macro task counts in the ngZone.
  3. Click Button Make Failed Request and see the error response.
  4. Click Button Check Task Counts again and notice that the macroTask count is now 1.
  5. Repeat failed requests as many times as you like and the marcroTask count will just keep increasing.

🔥 Exception or Error

image

No macroTasks should be left running after this failed http request.

🌍 Your Environment

Angular Version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.1.0
Node: 10.20.1
OS: linux x64

Angular: 10.1.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1001.0
@angular-devkit/build-angular     0.1001.0
@angular-devkit/build-optimizer   0.1001.0
@angular-devkit/build-webpack     0.1001.0
@angular-devkit/core              10.1.0
@angular-devkit/schematics        10.1.0
@angular/cli                      10.1.0
@ngtools/webpack                  10.1.0
@schematics/angular               10.1.0
@schematics/update                0.1001.0
rxjs                              6.6.3
typescript                        4.0.2
webpack                           4.44.1

Anything else relevant? Error occurs in both browsers I tested with Chrome and Firefox.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JiaLiPassioncommented, Sep 14, 2020

@JoostK , sure, I just checked this one, I think this can be handled inside zone.js, it is a bug about integrated zone.js with @angular/common/http, I will fix it.

0reactions
angular-automatic-lock-bot[bot]commented, Nov 6, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to track which async tasks protractor is waiting on?
A bit trickier solution · Go to node_modules/zone.js/dist/zone.js . · Look for Zone's constructor function: function Zone(parent, zoneSpec) · Add ...
Read more >
spawn Unknown system error -86 >> From: Task: WebDriver ...
So I have been working in Protractor for my end to end tests of my Angular application. It has been working for as...
Read more >
Subsurface Investigations - Federal Highway Administration
rock coring, sampling, in-situ testing, and geophysical exploration methods. ' Chapters 7 and 8 discuss laboratory testing of soil and rock materials.
Read more >
Automated Testing Techniques for Event-Driven and ... - Pure
We present a new methodology that extends the error detection capabilities of existing, manually written Android test suites. In the context of.
Read more >
9 Testing and Profiling Java Application Projects
A Selenium Mocha/Protractor test case with a default test method is created. ... profiling task you are running on the target application without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found