The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Deflake the upsert suite teardown against in-flight background jobs (#24804)
Charles Bochet46a5e0959601
diff --git a/packages/twenty-server/test/integration/graphql/suites/upsert/upsert.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/upsert/upsert.integration-spec.tsindex d2defba17fc..386d33b37b6 100644--- a/packages/twenty-server/test/integration/graphql/suites/upsert/upsert.integration-spec.ts+++ b/packages/twenty-server/test/integration/graphql/suites/upsert/upsert.integration-spec.ts@@ -4,6 +4,7 @@ import { createOneFieldMetadata } from 'test/integration/metadata/suites/field-mimport { createOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/create-one-object-metadata.util';import { deleteOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/delete-one-object-metadata.util';import { updateOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/update-one-object-metadata.util';+import { waitForAllJobsToFinish } from 'test/integration/utils/wait-for-all-jobs-to-finish.util';import { FieldMetadataType } from 'twenty-shared/types';const createRecordsQuery = gql`@@ -103,6 +104,9 @@ describe('upsert (createMany with upsert:true)', () => {});afterEach(async () => {+ // The global wait-for-jobs afterEach runs after this one, so drain jobs first or the deletion migration can deadlock against them.+ await waitForAllJobsToFinish();+await updateOneObjectMetadata({expectToFail: false,input: {