Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error "Cannot read property 'afterContentPaint' of null" when running tests #72

Closed
nrcjbarry opened this issue Sep 12, 2017 · 23 comments · Fixed by #73
Closed

Comments

@nrcjbarry
Copy link

Occasionally on our build server, I get a failing test with the following error: Cannot read property 'afterContentPaint' of null

There are only 2 hits on Google for afterContentPaint, and one of them is this issue: ember-app-scheduler/ember-app-scheduler#9

This addon seems to be the only thing using that library. Have you ran into this error while using ember-router-scroll?

@briangonzalez
Copy link
Contributor

@cclo7 Any ideas?

@nrcjbarry
Copy link
Author

I am using headless Chrome to run my tests with this testem.js config:

module.exports = {
  test_page: 'tests/index.html?hidepassed',
  disable_watching: true,
  launch_in_ci: [
    'Chrome'
  ],
  launch_in_dev: [
  ],
  browser_args: {
    Chrome: [
      '--disable-gpu',
      '--headless',
      '--remote-debugging-port=9222',
      '--window-size=1440,900'
    ]
  }
};

@cclo7
Copy link
Contributor

cclo7 commented Sep 14, 2017

@nrcjbarry what type of tests are you running when encountering this error? Acceptance, integration, or unit test?

@nrcjbarry
Copy link
Author

@cclo7 I have only seen it happen in acceptance tests.

@kpfefferle
Copy link

I too am getting this during (some) acceptance tests

@cclo7
Copy link
Contributor

cclo7 commented Sep 16, 2017

@sreedhar7 any ideas?

@nrcjbarry
Copy link
Author

I also get this on my local machine too both when running ember test and ember test --server. I'm using Ember 2.15 and Ember CLI 2.15.1.

Here is a screen shot of the stack trace on one of them:

screen shot 2017-09-12 at 12 18 42 pm

@YoranBrondsema
Copy link
Contributor

I encountered the same issue after an upgrade to Ember.js 2.15. I dug a bit deeper into it and I may have found out the cause. I don't think the error is in ember-router-scroll but rather in ember-app-scheduler.

I provide more explanation here: ember-app-scheduler/ember-app-scheduler#11.

@YoranBrondsema
Copy link
Contributor

Nevermind, I got it wrong... I figured out later that this addon uses an old version of ember-app-scheduler. PR #73 updates it to the latest version and that fixed the problem for me.

briangonzalez pushed a commit that referenced this issue Oct 8, 2017
* Update ember-app-scheduler to 0.2.0

* Fix ESLint error
@ryanto
Copy link
Contributor

ryanto commented Feb 27, 2018

I'm still getting this error in my application's acceptance tests. Wondering if 0.2.0 fixed it for everyone else?

@RobbieTheWagner
Copy link
Contributor

@ryanto do you mean 0.4.0? That is the latest release.

@nrcjbarry
Copy link
Author

@ryanto it was fixed for me for months up until I upgraded to Ember 3.0 last week. I started seeing this error again only on one test (the same test) every time. I fixed it by deleting my package-lock.json file and doing another npm install. I haven't seen it in the last 2 days.

@ryanto
Copy link
Contributor

ryanto commented Feb 27, 2018

I'm running master, but this could be something I'm doing in my app. Just wanted to ask.

@snewcomer
Copy link
Collaborator

snewcomer commented Feb 27, 2018

I haven't seen this error in a month or so (which before saw quite often in our CI build...on 0.4.0 then). Note we are on [email protected] and 0.5.0 for ember-router-scroll @ryanto

@bantic
Copy link

bantic commented Mar 20, 2018

I'm still seeing this error as well, fairly sporadically in acceptance tests. Using ember-router-scroll 0.5.0 and ember-app-scheduler 0.2.1. Still looking into why, but I'm curious if anyone else is still getting it, or has a suggestion for a fix.

@snewcomer
Copy link
Collaborator

@bantic I think it is 👇. It's close to being done...made a PR to get the tests passing and have been awaiting feedback. Maybe I should push to his master instead 🤔

ember-app-scheduler/ember-app-scheduler#15

san650 added a commit to san650/ember-cli-addon-docs that referenced this issue Apr 10, 2018
This fixes a known issue where you can get random failing tests.

See DockYard/ember-router-scroll#72
san650 added a commit to san650/ember-cli-addon-docs that referenced this issue Apr 10, 2018
This fixes a known issue where you can get randomly failing tests.

See DockYard/ember-router-scroll#72
san650 added a commit to san650/ember-cli-addon-docs that referenced this issue Apr 10, 2018
This fixes a known issue where you can get randomly failing tests.

See DockYard/ember-router-scroll#72
san650 added a commit to san650/ember-cli-addon-docs that referenced this issue Apr 19, 2018
This fixes a known issue where you can get randomly failing tests.

See DockYard/ember-router-scroll#72
@ryanto
Copy link
Contributor

ryanto commented May 7, 2018

Still seeing this. From following development on ember-app-scheduler it looks like this PR could maybe be a fix.

#129

Update: Unfortunately that PR does not fix it.

@samselikoff
Copy link
Contributor

I believe we're still seeing this, and the root cause is the issue in ember-app-scheduler. If it's still an issue (and wasn't fixed by #73), could we have this issue re-opened to make the communication & updates easier to follow?

@snewcomer
Copy link
Collaborator

@samselikoff @ryanto What version are you guys on? Still master? I perhaps would have thought the PR to make app-scheduler optional would have fixed it. I would imagine your code is never calling scheduleWork, right?

https://github.com/dollarshaveclub/ember-router-scroll/blob/master/addon/index.js#L32

@ryanto
Copy link
Contributor

ryanto commented May 16, 2018

Ah thanks for pointing that out! I didn't realize this was an option... Let me give it a try.

@rtablada
Copy link

@snewcomer/@ryanto heads up the issue actually seems to lie in the flushQueue from Ember App Scheduler which runs even though router-scroll isn't directly using it. Since the service is still injected and initialized these lifecycles are still happening.

I have made a PR ember-app-scheduler/ember-app-scheduler#45 to address this and check for service lifecycles.

@rtablada
Copy link

I'm not sure how ember-app-scheduler will handle porting back to version 2.* as listed as a dependency for ember-router-scroll.

@snewcomer
Copy link
Collaborator

@ryanto @bantic Whenever you have a chance, mind giving this branch a spin? I tried it and seems to work great. Just probably need another approval and we can merge and release a new version!

#139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.