enzymejs/enzyme

mount goes Out of Memory

Ouverte

#1 642 ouverte le 2 mai 2018

 (4 commentaires) (0 réaction) (0 personne assignée)JavaScript (1 967 forks)batch import
Need To Reproducebughelp wanted

Métriques du dépôt

Stars
 (19 825 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Component: https://github.com/dowjones/react-dropdown-tree-select/blob/perf-tweaks/src/tree/index.js

Test: https://github.com/dowjones/react-dropdown-tree-select/blob/perf-tweaks/src/tree/index.test.js#L48

Branch with repro: https://github.com/dowjones/react-dropdown-tree-select/tree/perf-tweaks

React has no issues with it. Test pages (yarn demo) works fine on Chrome, Edge browsers with no issues. Only mount fails.

This test started failing after adding react-infinite-scroll-component. However, I'm not sure why. I've checked their source code and nothing stands out of the ordinary. If I take out the component, test runs fine.

Current behavior

mount(<Tree data={treeManager.tree} />) throws Out of Memory error.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node_module_register
 2: v8::internal::FatalProcessOutOfMemory
 3: v8::internal::FatalProcessOutOfMemory
 4: v8::internal::Factory::NewUninitializedFixedArray
 5: v8::internal::WasmDebugInfo::SetupForTesting
 6: v8::internal::WasmDebugInfo::SetupForTesting
 7: v8::internal::WasmDebugInfo::SetupForTesting
 8: v8::internal::WasmDebugInfo::SetupForTesting
 9: v8::internal::SharedFunctionInfo::SetScript
10: v8::internal::JSReceiver::class_name
11: v8::internal::JSReceiver::class_name
12: v8::internal::JSReceiver::class_name
13: v8::internal::SourcePositionTableIterator::Advance
14: 0000030A229843C1

Expected behavior

Should not throw Out of memory error.

Your environment

node: v8.11.1 npm: 5.6.0

Win 10 x64

#### API

- [ ] shallow
- [X ] mount
- [ ] render

#### Version

| library         | version
| ---------------- | -------
| Enzyme           | ^3.3.0
| React            |  ^16.0.0

#### Adapter

- [x] enzyme-adapter-react-16
- [ ] enzyme-adapter-react-15
- [ ] enzyme-adapter-react-15.4
- [ ] enzyme-adapter-react-14
- [ ] enzyme-adapter-react-13
- [ ] enzyme-adapter-react-helper
- [ ] others ( ) 

Guide contributeur