Skip to content

Crashes while looking for helper files in huge project subdirectories #1228

@transcranial

Description

@transcranial

Currently, ava looks for helper files in all project subdirectories excluding node_modules:

https://github.com/avajs/ava/blob/master/lib/ava-files.js#L90-L95

This can overwhelm ava when there exists subdirectories that are huge and/or with complicated fs hierarchies:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [ava]
 2: 0x126389c [ava]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [ava]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ava]
 5: v8::internal::Factory::NewInternalizedStringImpl(v8::internal::Handle<v8::internal::String>, int, unsigned int) [ava]
 6: v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [ava]
 7: v8::internal::LookupIterator::PropertyOrElement(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, bool*, v8::internal::LookupIterator::Configuration) [ava]
 8: v8::internal::Runtime_KeyedGetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [ava]
 9: 0x126964c063a7
Aborted (core dumped)

Allowing the specification of exclusion globs for helper files would help prevent this. We reverted back to v0.17.0 for now.

Environment:
node v7.4.0
linux 4.2.0-34-generic
ava v0.18.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredscope:globbing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions