style: typo

This commit is contained in:
LongYinan 2021-05-29 23:36:49 +08:00
parent 6fb68d018d
commit 4ffc513c3f
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -43,13 +43,13 @@ export async function createSuite(testFile, maxMemoryUsage) {
const stats = await container.stats()
let shouldAssetMemoryUsage = false
let shouldAssertMemoryUsage = false
const initialMemoryUsage = await new Promise((resolve, reject) => {
stats.on('data', (d) => {
const { memory_stats } = JSON.parse(d.toString('utf8'))
resolve(memory_stats.usage)
if (shouldAssetMemoryUsage && memory_stats?.usage) {
if (shouldAssertMemoryUsage && memory_stats?.usage) {
const memoryGrowth = memory_stats.usage - initialMemoryUsage
if (memoryGrowth > maxMemoryUsage ?? initialMemoryUsage) {
console.info(
@ -72,7 +72,7 @@ export async function createSuite(testFile, maxMemoryUsage) {
await sleep(60000)
shouldAssetMemoryUsage = true
shouldAssertMemoryUsage = true
await container.stop()
await container.remove()