-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Our Jest test segfaults when closing the Realm when running on Node 12 in certain conditions (specifically, it seems like a timing issue which can be triggered by running `npm install` before running the tests). This started happening since https://github.com/realm/realm-core/pull/4892.
It seems that the Node environment is possibly being torn down before the Realm is fully closed. See referenced doc for investigation notes.
We have worked around this in https://github.com/realm/realm-js/pull/4025 by calling `setTimeout` with a timeout of 0 at the end of the test. We are assuming that this is an edge case caused by a very specific timing issue on a specific Node version (which will end LTS in May 2022), rather than a real issue in the code, but it may warrant further investigation if we see other possibly related issues.