Skip to content

Commit

Permalink
add timeout for other test
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Jan 9, 2025
1 parent f6a2bc8 commit 8a146e3
Showing 1 changed file with 62 additions and 58 deletions.
120 changes: 62 additions & 58 deletions packages/lambda/src/test/integration/renders/regular-audio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,76 @@ afterAll(async () => {
await RenderInternals.killAllBrowsers();
});

test('Should make regular (non-seamless) audio', async () => {
const {close, file, progress, renderId} = await simulateLambdaRender({
codec: 'wav',
composition: 'framer',
frameRange: [100, 200],
imageFormat: 'none',
logLevel: 'error',
region: 'eu-central-1',
inputProps: {playbackRate: 2},
});
test(
'Should make regular (non-seamless) audio',
async () => {
const {close, file, progress, renderId} = await simulateLambdaRender({
codec: 'wav',
composition: 'framer',
frameRange: [100, 200],
imageFormat: 'none',
logLevel: 'error',
region: 'eu-central-1',
inputProps: {playbackRate: 2},
});

const wav = path.join(process.cwd(), 'regular.wav');
await new Promise<void>((resolve) => {
file.pipe(createWriteStream(wav)).on('finish', () => resolve());
});
const wav = path.join(process.cwd(), 'regular.wav');
await new Promise<void>((resolve) => {
file.pipe(createWriteStream(wav)).on('finish', () => resolve());
});

const wd = new Wavedraw(wav);
const wd = new Wavedraw(wav);

const snapShot = path.join(__dirname, 'regular-audio.bmp');
const snapShot = path.join(__dirname, 'regular-audio.bmp');

const options = {
width: 600,
height: 300,
rms: true,
maximums: true,
average: false,
start: 'START' as const,
end: 'END' as const,
colors: {
maximums: '#0000ff',
rms: '#659df7',
background: '#ffffff',
},
filename: snapShot,
};
const options = {
width: 600,
height: 300,
rms: true,
maximums: true,
average: false,
start: 'START' as const,
end: 'END' as const,
colors: {
maximums: '#0000ff',
rms: '#659df7',
background: '#ffffff',
},
filename: snapShot,
};

wd.drawWave(options); // outputs wave drawing to example1.png
wd.drawWave(options); // outputs wave drawing to example1.png

const files = await mockImplementation.listObjects({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
expectedBucketOwner: 'abc',
prefix: rendersPrefix(renderId),
forcePathStyle: false,
});
const files = await mockImplementation.listObjects({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
expectedBucketOwner: 'abc',
prefix: rendersPrefix(renderId),
forcePathStyle: false,
});

expect(files.length).toBe(2);
expect(files.length).toBe(2);

await internalDeleteRender({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
renderId,
providerSpecifics: mockImplementation,
forcePathStyle: false,
});
await internalDeleteRender({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
renderId,
providerSpecifics: mockImplementation,
forcePathStyle: false,
});

const expectFiles = await mockImplementation.listObjects({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
expectedBucketOwner: 'abc',
prefix: rendersPrefix(renderId),
forcePathStyle: false,
});
const expectFiles = await mockImplementation.listObjects({
bucketName: progress.outBucket as string,
region: 'eu-central-1',
expectedBucketOwner: 'abc',
prefix: rendersPrefix(renderId),
forcePathStyle: false,
});

expect(expectFiles.length).toBe(0);
expect(expectFiles.length).toBe(0);

unlinkSync(wav);
await close();
});
unlinkSync(wav);
await close();
},
{timeout: 30000},
);

0 comments on commit 8a146e3

Please sign in to comment.