Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1098

Slow Teardown for Realm

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      While testing issues with Jest, I noticed that the teardown for Realm is quite slow. A simple open and close will take about 10 seconds before the process finally closes.
      Here is a sample in Jest:

      describe('realm', () => {
        it('can open without crashing', async () => {
          const realm = await Realm.open({schema:[TodoList, TodoItem], inMemory:true})
          realm.close()
          expect(1).toEqual(1)
        })
      })
      

      Here is an example in Node:

      const Realm = require("realm");
      
      let realm = new Realm( { schema: [
          {
              name: "Simple",
              properties: {
                  v: "string",
              }
          }
      ]});
      realm.write(() => {
          realm.create("Simple", { v: "Hello" });
      });
      realm.close();
      

      We should see if it's possible to make the teardown instantaneous.

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.meyer@mongodb.com Andrew Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: