Why doesn’t Playwright reporter wait for async functions to complete?

I am using custom playwright reporter (but I think this issue is not only tied to reporter) and there in async OnTestEnd(test, result) I am trying to run exec command. With debugger turned on I see that as soon as program reaches this exec function it skips it and it ends.

async onTestEnd(test, result){
    const cmd = "some complex command"
    return new Promise((resolve, reject) => {
      exec(cmd, { timeout: 10000 }, (error, stdout, stderr) => {  // 10-seconds timeout
        if (error) {`enter code here`
          reject(error);
          return;
        }
        
        if (stderr) {
          reject(stderr);
          return;
        }
        resolve(stdout);
      });
    });
}

Above is one of many attempts to correctly run this function. But it skips all the time.