Files
klz-cables.com/.pnpm-store/v10/files/49/fcc62220e35b1377a85a08b873582af3ea29962bf265cba79ec4b4f59825908231e70bc4df116ad14b6dce0f03a0b1164358d4db4ecd564b9b7c8b789e5838
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

44 lines
1.2 KiB
Plaintext

'use strict'
const { test } = require('tap')
const { join } = require('node:path')
const { createReadStream } = require('node:fs')
const { promisify } = require('node:util')
const execa = require('execa')
const split = require('split2')
const stream = require('node:stream')
const { file } = require('../helper')
const pipeline = promisify(stream.pipeline)
const { Writable } = stream
const sleep = promisify(setTimeout)
const skip = process.env.CI || process.env.CITGM
test('eight million lines', { skip }, async ({ equal, comment }) => {
const destination = file()
await execa(process.argv[0], [join(__dirname, '..', 'fixtures', 'transport-many-lines.js'), destination])
if (process.platform !== 'win32') {
try {
await execa('sync') // Wait for the file to be written to disk
} catch {
// Just a fallback, this should be unreachable
}
}
await sleep(1000) // It seems that sync is not enough (even in POSIX systems)
const toWrite = 8 * 1000000
let count = 0
await pipeline(createReadStream(destination), split(), new Writable({
write (chunk, enc, cb) {
if (count % (toWrite / 10) === 0) {
comment(`read ${count}`)
}
count++
cb()
}
}))
equal(count, toWrite)
})