mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
fix: create traces dir in /tmp instead of cwd (#11699)
This commit is contained in:
parent
d305a2ab3f
commit
480338d5f3
@ -31,8 +31,6 @@ import { helper } from './helper';
|
||||
import { RecentLogsCollector } from '../utils/debugLogger';
|
||||
import { CallMetadata, SdkObject } from './instrumentation';
|
||||
|
||||
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
|
||||
|
||||
export abstract class BrowserType extends SdkObject {
|
||||
private _name: BrowserName;
|
||||
readonly _playwrightOptions: PlaywrightOptions;
|
||||
@ -143,7 +141,7 @@ export abstract class BrowserType extends SdkObject {
|
||||
if (options.tracesDir)
|
||||
await fs.promises.mkdir(options.tracesDir, { recursive: true });
|
||||
|
||||
const artifactsDir = await fs.promises.mkdtemp(ARTIFACTS_FOLDER);
|
||||
const artifactsDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'playwright-artifacts-'));
|
||||
tempDirectories.push(artifactsDir);
|
||||
|
||||
if (userDataDir) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import fs from 'fs';
|
||||
import { APIRequestContext } from '../../fetch';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import yazl from 'yazl';
|
||||
import { NameValue } from '../../../common/types';
|
||||
@ -27,6 +27,7 @@ import { assert, calculateSha1, createGuid, mkdirIfNeeded, monotonicTime, remove
|
||||
import { Artifact } from '../../artifact';
|
||||
import { BrowserContext } from '../../browserContext';
|
||||
import { ElementHandle } from '../../dom';
|
||||
import { APIRequestContext } from '../../fetch';
|
||||
import { CallMetadata, InstrumentationListener, SdkObject } from '../../instrumentation';
|
||||
import { Page } from '../../page';
|
||||
import * as har from '../../supplements/har/har';
|
||||
@ -192,7 +193,7 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps
|
||||
private async _createTracesDirIfNeeded() {
|
||||
if (this._precreatedTracesDir)
|
||||
return this._precreatedTracesDir;
|
||||
this._tracesTmpDir = await fs.promises.mkdtemp('playwright-tracing-');
|
||||
this._tracesTmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'playwright-tracing-'));
|
||||
return this._tracesTmpDir;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user