1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

Fix test race conditions

This commit is contained in:
adrinr 2023-01-30 12:29:39 +00:00
parent 651c367f75
commit 7d279e2eca
3 changed files with 7 additions and 3 deletions

View file

@ -7,7 +7,7 @@ import { Config, context, events } from "@budibase/backend-core"
describe("configs", () => {
const config = new TestConfiguration()
beforeAll(async () => {
beforeEach(async () => {
await config.beforeAll()
})

View file

@ -6,7 +6,7 @@ import { EmailTemplatePurpose } from "../../../../constants"
describe("/api/global/email", () => {
const config = new TestConfiguration()
beforeAll(async () => {
beforeEach(async () => {
await config.beforeAll()
})

View file

@ -264,7 +264,11 @@ export const save = async (
builtUser._rev = response.rev
await eventHelpers.handleSaveEvents(builtUser, dbUser)
await addTenant(tenantId, _id, email)
if (!env.isTest()) {
// Race conditions (existing in prod already) with multiple tests synchronising the global db
// https://github.com/Budibase/budibase/issues/6134
await addTenant(tenantId, _id, email)
}
await cache.user.invalidateUser(response.id)
// let server know to sync user