-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledRejection: process.memoryUsage #6500
Comments
When I erase the line |
I'm not sure if vitest/packages/vitest/src/runtime/runners/test.ts Lines 80 to 82 in 318747d
The error vitest/packages/vitest/src/node/config/resolveConfig.ts Lines 225 to 235 in 16aa76c
vitest/packages/vitest/src/node/config/resolveConfig.ts Lines 769 to 771 in 318747d
|
Maybe Performance.measureUserAgentSpecificMemory() is equivalent to Node.js's async function getMemoryUsage() {
if (typeof performance !== 'undefined' && 'measureUserAgentSpecificMemory' in performance) {
try {
const memorySample = await performance.measureUserAgentSpecificMemory();
return memorySample.bytes;
} catch (error) {
console.error('Error measuring memory:', error);
return null;
}
} else {
console.warn('Performance.measureUserAgentSpecificMemory is not supported in this browser.');
return null;
}
}
if (this.config.logHeapUsage) {
getMemoryUsage().then(heapUsed => {
if (heapUsed !== null) {
test.result!.heap = heapUsed;
console.log('Heap Usage:', heapUsed);
}
});
} |
Describe the bug
𝐇ello˙. 𝐀m 𝐈 doing something wrong˙? ಥ_ಥ
Run the following script:
"test:browser": "vitest run",
It runs correctly. (。◕‿‿◕。)
Run the following script:
"test:browser-flaky": "vitest run --browser.enabled=true",
Message output in console ⚆ _ ⚆
Run the following script:
"test:browser-error": "vitest run --browser.enabled=true --coverage.enabled=false"
Message output in console ⚆ _ ⚆
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-gmzfxl?file=package.json
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: