fix: extend image request timeout to 15 minutes
This commit is contained in:
1 parent
99e087112b
commit
d9d69000e9
3 files changed
+10
-10
No files matched your search
@@ -256,19 +256,19 @@ test('specified generation options are preserved on the wire', async t => {
|
||||
await generateImages({ baseUrl, apiKey, input: specified });
|
||||
});
|
||||
|
||||
test('180 second timeout aborts a stalled request', async t => {
|
||||
test('900 second timeout aborts a stalled request', async t => {
|
||||
const baseUrl = await server(t, () => {});
|
||||
const original = globalThis.setTimeout;
|
||||
let configuredTimeout;
|
||||
t.mock.method(globalThis, 'setTimeout', (callback, milliseconds, ...args) => {
|
||||
if (milliseconds === 180_000) {
|
||||
if (milliseconds === 900_000) {
|
||||
configuredTimeout = milliseconds;
|
||||
return original(callback, 20, ...args);
|
||||
}
|
||||
return original(callback, milliseconds, ...args);
|
||||
});
|
||||
await assert.rejects(listModels({ baseUrl, apiKey }), /timed out after 180 seconds/);
|
||||
assert.equal(configuredTimeout, 180_000);
|
||||
await assert.rejects(listModels({ baseUrl, apiKey }), /timed out after 900 seconds/);
|
||||
assert.equal(configuredTimeout, 900_000);
|
||||
});
|
||||
|
||||
test('edit response downloads omit auth and retain output validation and bounds', async t => {
|
||||
@@ -327,11 +327,11 @@ test('edits cancel pending API requests, downloads and pre-aborted requests', as
|
||||
assert.equal(count, 2);
|
||||
});
|
||||
|
||||
test('edits share the 180 second operation timeout', async t => {
|
||||
test('edits share the 900 second operation timeout', async t => {
|
||||
const baseUrl = await server(t, () => {});
|
||||
const original = globalThis.setTimeout;
|
||||
t.mock.method(globalThis, 'setTimeout', (callback, milliseconds, ...args) => original(callback, milliseconds === 180_000 ? 20 : milliseconds, ...args));
|
||||
await assert.rejects(editImages({ baseUrl, apiKey, input, image: png }), /timed out after 180 seconds/);
|
||||
t.mock.method(globalThis, 'setTimeout', (callback, milliseconds, ...args) => original(callback, milliseconds === 900_000 ? 20 : milliseconds, ...args));
|
||||
await assert.rejects(editImages({ baseUrl, apiKey, input, image: png }), /timed out after 900 seconds/);
|
||||
});
|
||||
|
||||
test('pre-aborted signal does not send an API request', async t => {
|
||||
|
||||
Reference in new issue
Block a user