Cypress: Ignore node_modules when watching files

Created on 21 Feb 2017  路  8Comments  路  Source: cypress-io/cypress

To potentially prevent issues such as https://github.com/cypress-io/cypress/issues/369, only watch the user's source files and ignore node_modules (and maybe other directories? https://github.com/novemberborn/ignore-by-default/blob/master/index.js).

topic enhancement

Most helpful comment

Fixed in 0.19.1.

All 8 comments

YES PLEASE!!!!!

Let's add a configuration option to cypress.json to allow users to configure other directories to ignore.

That sounds great 馃憤 anything I can do to help make this happen soon?

I'm afraid this is unlikely to solve your issue, @kentcdodds, or #369 for that matter. When we bundle the files, browserify has to walk the dependency tree and open all the files, whether they are in node_modules or not. It's at that point that we're getting the EMFILE error, which is why this is reproducible when running headlessly (where we don't watch the files).

I still think it's a good idea to implement this, but wanted to make it clear that it won't solve the EMFILE issue.

That makes sense. :-(

What doesn't make sense is that my app is actually pretty small and I don't experience this issue when doing things that I would expect to open many more files (like bundling a large app with webpack for example). I'll move discussion over to #369...

Actually your faker lib does require a bunch of files - but we think there's a deeper issue here, one that is not fixed by raising ulimit. It's also possible the way Cypress is spawned somehow doesn't respect the ulimit property but we'll have to do more research.

Could be that we might have to fork or proxyquire browserify to use graceful-fs which has EMFILE backoff.

We're experimenting to see what we can do...

It's also possible the way Cypress is spawned somehow doesn't respect the ulimit property but we'll have to do more research.

I think that may be it. When I run:

lsof | awk '{print $1}' | uniq -c | sort -rn | head

I see Cypress listed there, but it maxes out at around 500 files as far as I can tell...

Fixed in 0.19.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloscheddar picture carloscheddar  路  3Comments

jennifer-shehane picture jennifer-shehane  路  3Comments

tahayk picture tahayk  路  3Comments

simonhaenisch picture simonhaenisch  路  3Comments

szabyg picture szabyg  路  3Comments