Remove quota disabling, it didn't have much of an effect.
This commit is contained in:
parent
84542dd808
commit
e38d4c1e48
|
@ -1 +1 @@
|
||||||
Subproject commit bec35b4c27ec10fe31dc07f9d42d8bda426b8535
|
Subproject commit b28dbd549284cf450be7f25ad85aadf614d08f0b
|
|
@ -177,7 +177,6 @@ if (descriptions.length) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function expectRowUsage(expected: number, f: () => Promise<void>) {
|
async function expectRowUsage(expected: number, f: () => Promise<void>) {
|
||||||
return await quotas.withEnabled(async () => {
|
|
||||||
const before = await getRowUsage()
|
const before = await getRowUsage()
|
||||||
await f()
|
await f()
|
||||||
const after = await getRowUsage()
|
const after = await getRowUsage()
|
||||||
|
@ -198,7 +197,6 @@ if (descriptions.length) {
|
||||||
expect(usage).toBeGreaterThan(expected * 0.9)
|
expect(usage).toBeGreaterThan(expected * 0.9)
|
||||||
expect(usage).toBeLessThan(expected * 1.1)
|
expect(usage).toBeLessThan(expected * 1.1)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultRowFields = isInternal
|
const defaultRowFields = isInternal
|
||||||
|
|
|
@ -2830,14 +2830,12 @@ if (descriptions.length) {
|
||||||
expected: number,
|
expected: number,
|
||||||
f: () => Promise<T>
|
f: () => Promise<T>
|
||||||
): Promise<T> {
|
): Promise<T> {
|
||||||
return await quotas.withEnabled(async () => {
|
|
||||||
const before = await getRowUsage()
|
const before = await getRowUsage()
|
||||||
const result = await f()
|
const result = await f()
|
||||||
const after = await getRowUsage()
|
const after = await getRowUsage()
|
||||||
const usage = after - before
|
const usage = after - before
|
||||||
expect(usage).toBe(expected)
|
expect(usage).toBe(expected)
|
||||||
return result
|
return result
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it("should be able to delete a row", async () => {
|
it("should be able to delete a row", async () => {
|
||||||
|
|
|
@ -44,13 +44,11 @@ describe("test the openai action", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const expectAIUsage = async <T>(expected: number, f: () => Promise<T>) => {
|
const expectAIUsage = async <T>(expected: number, f: () => Promise<T>) => {
|
||||||
return await quotas.withEnabled(async () => {
|
|
||||||
const before = await getAIUsage()
|
const before = await getAIUsage()
|
||||||
const result = await f()
|
const result = await f()
|
||||||
const after = await getAIUsage()
|
const after = await getAIUsage()
|
||||||
expect(after - before).toEqual(expected)
|
expect(after - before).toEqual(expected)
|
||||||
return result
|
return result
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it("should be able to receive a response from ChatGPT given a prompt", async () => {
|
it("should be able to receive a response from ChatGPT given a prompt", async () => {
|
||||||
|
|
Loading…
Reference in New Issue