mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: bump the trace packet size to be 1Mb (#22446)
This commit is contained in:
parent
00df08b3cf
commit
9f661b710a
@ -40,8 +40,8 @@ class StreamImpl extends Readable {
|
||||
this._channel = channel;
|
||||
}
|
||||
|
||||
override async _read(size: number) {
|
||||
const result = await this._channel.read({ size });
|
||||
override async _read() {
|
||||
const result = await this._channel.read({ size: 1024 * 1024 });
|
||||
if (result.binary.byteLength)
|
||||
this.push(result.binary);
|
||||
else
|
||||
|
||||
@ -73,7 +73,7 @@ export class ArtifactDispatcher extends Dispatcher<Artifact, channels.ArtifactCh
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const readable = fs.createReadStream(localPath);
|
||||
const readable = fs.createReadStream(localPath, { highWaterMark: 1024 * 1024 });
|
||||
const stream = new StreamDispatcher(this, readable);
|
||||
// Resolve with a stream, so that client starts saving the data.
|
||||
resolve({ stream });
|
||||
@ -94,7 +94,7 @@ export class ArtifactDispatcher extends Dispatcher<Artifact, channels.ArtifactCh
|
||||
const fileName = await this._object.localPathAfterFinished();
|
||||
if (!fileName)
|
||||
return {};
|
||||
const readable = fs.createReadStream(fileName);
|
||||
const readable = fs.createReadStream(fileName, { highWaterMark: 1024 * 1024 });
|
||||
return { stream: new StreamDispatcher(this, readable) };
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user