Deleted flakey test

refs https://github.com/TryGhost/Team/issues/2891

This test is failing more and more frequently and is being removed with the
intention of reinstating it once it has been fixed
This commit is contained in:
Fabien "egg" O'Carroll 2023-04-04 20:16:44 +07:00
parent cb8032911c
commit 41e8c20d88

View File

@ -11,7 +11,6 @@ const escapeRegExp = require('lodash/escapeRegExp');
const configUtils = require('../../../utils/configUtils'); const configUtils = require('../../../utils/configUtils');
const {settingsCache} = require('../../../../core/server/services/settings-helpers'); const {settingsCache} = require('../../../../core/server/services/settings-helpers');
const DomainEvents = require('@tryghost/domain-events'); const DomainEvents = require('@tryghost/domain-events');
const emailService = require('../../../../core/server/services/email-service');
const should = require('should'); const should = require('should');
const {mockSetting, stripeMocker} = require('../../../utils/e2e-framework-mock-manager'); const {mockSetting, stripeMocker} = require('../../../utils/e2e-framework-mock-manager');
@ -344,33 +343,6 @@ describe('Batch sending tests', function () {
assert.equal(memberIds.length, _.uniq(memberIds).length); assert.equal(memberIds.length, _.uniq(memberIds).length);
}); });
it('Protects the email job from being run multiple times at the same time', async function () {
// Prepare a post and email model
const emailModel = await createPublishedPostEmail();
assert.equal(emailModel.get('source_type'), 'mobiledoc');
assert(emailModel.get('subject'));
assert(emailModel.get('from'));
// Retry sending a couple of times
const promises = [];
for (let i = 0; i < 100; i++) {
promises.push(emailService.service.retryEmail(emailModel));
}
await Promise.all(promises);
// Await sending job
await jobManager.allSettled();
await emailModel.refresh();
assert.equal(emailModel.get('status'), 'submitted');
assert.equal(emailModel.get('email_count'), 4);
// Did we create batches?
const batches = await models.EmailBatch.findAll({filter: `email_id:${emailModel.id}`});
assert.equal(batches.models.length, 1);
});
it('Doesn\'t include members created after the email in the batches', async function () { it('Doesn\'t include members created after the email in the batches', async function () {
// If we create a new member (e.g. a member that was imported) after the email was created, they should not be included in the email // If we create a new member (e.g. a member that was imported) after the email was created, they should not be included in the email
const addStub = sinon.stub(models.Email, 'add'); const addStub = sinon.stub(models.Email, 'add');