-
-
Notifications
You must be signed in to change notification settings - Fork 325
Labels
mobileSuite Lite issues and PRsSuite Lite issues and PRs
Description
All mobile trade based tests are now ignored in CI because they were causing unit tests pipeline to be stopped due the timeout.
What we know
module-tradingtests take around 2 mins locally and around 12 minutes in CI.- All tests (including trading ones) run over 30 minutes. Which is causing pipeline to be canceled.
- Pipeline often freezes for few minutes when running
@suite-native/test-utilsbased tests for no obvious reason.
- Every
@suite-native/test-utilsbased test allocates around 320MB of memory (caused mostly by redux-store initialization) and leaks ~32MB. This is causing cost on every other subsequent test initialization.- Setting
workerIdleMemoryLimit: '1024MB'helps a bit, but does not resolves the problem with extremely slow pipeline. - Setting
maxWorkersseems to not help at all.
- Setting
- There is a circular dependency between
state -> multiple modules -> test-utils -> statethat cannot be solved, if we want to be able to test components dependant on redux. This might or might not cause some problems. - Setting
workerIdleMemoryLimit: '1024MB'actually helped a lot and saved like 10 minutes of pipeline time, but pipeline get gradually slower recently. It seems that this slowdown is not caused bymodule-tradingbut some other changes. Possibly by upgrade of some module or nx cache?
Possible solutions
I have no idea if anything of this will help, but those are my most promising guesses so far.
Get rid of memory leaks
- Including
initStorecauses memory leaks (and allocates 320MB before every tests suite) - Including
FormatterProvidercauses memory leaks (and allocates 90MB before every tests suite)
To run tests with heap usage reporting use
cd to_module_you_want_to_test
node --expose-gc ../../node_modules/.bin/jest --runInBand --logHeapUsage .
Make sure NX remote cache is not the cause of freezes
- Try to run tests without nx cache, compare time required.
Do not use redux provider
initStoreand@suite-native/statemodules are the main eaters of memory. Not including them in tests may mitigate the problem.
Do not use testing-library/react-native
- Maybe we should migrate to another testing framework as a extreme solution.
Use vitest instead of jest
vitestis known for better performance thenjest, though usingvitestwith RN andtesting-library/react-nativemight be not as straightforward.
Metadata
Metadata
Assignees
Labels
mobileSuite Lite issues and PRsSuite Lite issues and PRs
Type
Projects
Status
🎯 To do
Status
🏃♀️ In progress