Fix test race conditions
This commit is contained in:
parent
651c367f75
commit
7d279e2eca
|
@ -7,7 +7,7 @@ import { Config, context, events } from "@budibase/backend-core"
|
||||||
describe("configs", () => {
|
describe("configs", () => {
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration()
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { EmailTemplatePurpose } from "../../../../constants"
|
||||||
describe("/api/global/email", () => {
|
describe("/api/global/email", () => {
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration()
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,11 @@ export const save = async (
|
||||||
builtUser._rev = response.rev
|
builtUser._rev = response.rev
|
||||||
|
|
||||||
await eventHelpers.handleSaveEvents(builtUser, dbUser)
|
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)
|
await cache.user.invalidateUser(response.id)
|
||||||
|
|
||||||
// let server know to sync user
|
// let server know to sync user
|
||||||
|
|
Loading…
Reference in New Issue