message: chore(shell-api): add interrupt/resume integration test
diff: @@ -2011,6 +2011,7 @@ describe('Shell API (integration)', function() {
  it('DBQuery.batchSize takes precedence over config', async() => {
  await shellApi.config.set('batchSize', 10);
  shellApi.DBQuery.batchSize = 30;
  + expect(shellApi.DBQuery.batchSize).to.equal(30);
  expect((await collection.find()._it()).documents).to.have.lengthOf(30);
  });
  @@ -2086,4 +2087,22 @@ describe('Shell API (integration)', function() {
  });
  });
  });
  +
  + describe('interruption', () => {
  + it('allows interrupting and resuming Mongo instances', async() => {
  + expect(internalState.interrupted.isSet()).to.equal(false);
  + expect(await database.runCommand({ ping: 1 })).to.deep.equal({ ok: 1 });
  + await internalState.onInterruptExecution();
  + expect(internalState.interrupted.isSet()).to.equal(true);
  + try {
  + await database.runCommand({ ping: 1 });
  + expect.fail('missed exceptino');
  + } catch (e) {
  + expect(e.name).to.equal('MongoshInterruptedError');
  + }
  + await internalState.onResumeExecution();
  + expect(internalState.interrupted.isSet()).to.equal(false);
  + expect(await database.runCommand({ ping: 1 })).to.deep.equal({ ok: 1 });
  + });
  + });
  });
  