Complete V1 RC deployment capability gates
This commit is contained in:
@@ -76,7 +76,7 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
init(timelineValue: unknown, assets: Array<{ sourceId: string; data: ArrayBuffer }>): Promise<{ stripCount: number; bucketCount: number; referenceCount: number; estimatedBytes: number }>;
|
||||
seek(frame: number, decodeDelayMs?: number): Promise<import("/src/sequencer/LongMediaTimeline.ts").LongMediaSeekResultIR>;
|
||||
cancel(): void;
|
||||
dispose(): Promise<number>;
|
||||
dispose(): Promise<{ releasedCacheBytes: number; cacheBytesAfter: number }>;
|
||||
terminate(): void;
|
||||
}
|
||||
const createWorkerClient = (): WorkerClient => {
|
||||
@@ -84,12 +84,12 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
let counter = 0;
|
||||
let readyResolve: ((value: { stripCount: number; bucketCount: number; referenceCount: number; estimatedBytes: number }) => void) | undefined;
|
||||
let readyReject: ((reason: Error) => void) | undefined;
|
||||
let disposeResolve: ((bytes: number) => void) | undefined;
|
||||
let disposeResolve: ((status: { releasedCacheBytes: number; cacheBytesAfter: number }) => void) | undefined;
|
||||
const pending = new Map<string, { resolve: (value: import("/src/sequencer/LongMediaTimeline.ts").LongMediaSeekResultIR) => void; reject: (reason: Error) => void }>();
|
||||
worker.onmessage = (event: MessageEvent<any>) => {
|
||||
const message = event.data;
|
||||
if (message.type === "ready") { readyResolve?.(message.index); readyResolve = undefined; readyReject = undefined; return; }
|
||||
if (message.type === "disposed") { disposeResolve?.(message.cacheBytes); disposeResolve = undefined; return; }
|
||||
if (message.type === "disposed") { disposeResolve?.({ releasedCacheBytes: message.releasedCacheBytes, cacheBytesAfter: message.cacheBytesAfter }); disposeResolve = undefined; return; }
|
||||
if (message.type === "error") {
|
||||
if (message.requestId) { pending.get(message.requestId)?.reject(new Error(message.message)); pending.delete(message.requestId); }
|
||||
else { readyReject?.(new Error(message.message)); readyResolve = undefined; readyReject = undefined; }
|
||||
@@ -164,7 +164,7 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
const serialized = serializeLongMediaSessionManifest(manifest);
|
||||
const manifestSha256 = Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", serialized.slice(0))), (value) => value.toString(16).padStart(2, "0")).join("");
|
||||
const storedSession = await writer.putAsset(projectId, serialized, "application/vnd.blender.long-media+json", "cache/long-media-session.json");
|
||||
const cacheBytesBeforeDispose = await client.dispose();
|
||||
const disposed = await client.dispose();
|
||||
client.terminate();
|
||||
writer.terminate();
|
||||
|
||||
@@ -180,7 +180,7 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
{ sourceId: "media:audio", data: reopenedAudio.data },
|
||||
]);
|
||||
const reopenedSeek = await restarted.seek(reopenedManifest.currentFrame);
|
||||
const restartedCacheBytes = await restarted.dispose();
|
||||
const restartedDisposed = await restarted.dispose();
|
||||
restarted.terminate();
|
||||
|
||||
const codec = gateSequencerCodec("video/mp4", new Set(["image/png", "audio/wav"]));
|
||||
@@ -207,8 +207,8 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
randomSeekMs,
|
||||
latest: [superseded.status, latest.status, latest.frame],
|
||||
cancelledSeek: cancelledSeek.status,
|
||||
cacheBytesBeforeDispose,
|
||||
restartedCacheBytes,
|
||||
disposed,
|
||||
restartedDisposed,
|
||||
manifestSha256,
|
||||
storedSessionSha256: storedSession.sha256,
|
||||
reopenedFrame: reopenedSeek.frame,
|
||||
@@ -230,6 +230,11 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
randomSeekMs: result.randomSeekMs,
|
||||
cacheBytes: result.randomCache?.bytes,
|
||||
evictions: result.randomCache?.evictions,
|
||||
releasedCacheBytes: result.disposed.releasedCacheBytes,
|
||||
cacheBytesAfterDispose: result.disposed.cacheBytesAfter,
|
||||
restartedReleasedCacheBytes: result.restartedDisposed.releasedCacheBytes,
|
||||
restartedCacheBytesAfterDispose: result.restartedDisposed.cacheBytesAfter,
|
||||
workerRestartRecovered: result.reopenedStatus === "COMPLETED",
|
||||
manifestSha256: result.manifestSha256,
|
||||
elapsedMs: result.elapsedMs,
|
||||
}));
|
||||
@@ -264,8 +269,10 @@ test("indexes, seeks, cancels and reopens a bounded one-million-frame media time
|
||||
expect(result.randomCache?.evictions).toBeGreaterThan(0);
|
||||
expect(result.randomCache?.keys).toEqual(expect.arrayContaining(["media:audio:597927", "media:image:1"]));
|
||||
expect(result.randomSeekMs).toBeLessThan(15_000);
|
||||
expect(result.cacheBytesBeforeDispose).toBeLessThanOrEqual(20 * 1024);
|
||||
expect(result.restartedCacheBytes).toBeLessThanOrEqual(20 * 1024);
|
||||
expect(result.disposed.releasedCacheBytes).toBeLessThanOrEqual(20 * 1024);
|
||||
expect(result.disposed.cacheBytesAfter).toBe(0);
|
||||
expect(result.restartedDisposed.releasedCacheBytes).toBeLessThanOrEqual(20 * 1024);
|
||||
expect(result.restartedDisposed.cacheBytesAfter).toBe(0);
|
||||
expect(result.manifestSha256).toBe(result.storedSessionSha256);
|
||||
expect(result.manifestSha256).toBe("d2e7e3c5ed9ae4fda6fe358cebb474f5774f1d2037dff3df9b6dfde9e0bebd2d");
|
||||
expect(result.elapsedMs).toBeLessThan(30_000);
|
||||
|
||||
Reference in New Issue
Block a user