From 41e8c20d885e994af89494412713617ff9e88915 Mon Sep 17 00:00:00 2001 From: "Fabien \"egg\" O'Carroll" Date: Tue, 4 Apr 2023 20:16:44 +0700 Subject: [PATCH] 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 --- .../email-service/batch-sending.test.js | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/ghost/core/test/integration/services/email-service/batch-sending.test.js b/ghost/core/test/integration/services/email-service/batch-sending.test.js index 558ceb75f7..b444f31708 100644 --- a/ghost/core/test/integration/services/email-service/batch-sending.test.js +++ b/ghost/core/test/integration/services/email-service/batch-sending.test.js @@ -11,7 +11,6 @@ const escapeRegExp = require('lodash/escapeRegExp'); const configUtils = require('../../../utils/configUtils'); const {settingsCache} = require('../../../../core/server/services/settings-helpers'); const DomainEvents = require('@tryghost/domain-events'); -const emailService = require('../../../../core/server/services/email-service'); const should = require('should'); 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); }); - 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 () { // 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');