enzymejs/enzyme

mount goes Out of Memory

Open

#1642 aperta il 2 mag 2018

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)JavaScript (2016 fork)batch import
Need To Reproducebughelp wanted

Metriche repository

Star
 (19.979 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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 ( )

Guida contributor