Skip to content

Commit 32b7e4e

Browse files
committed
test: adjust slow tests
1 parent 1d87f18 commit 32b7e4e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/encoding/stream.test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ import { legacySingleByte, legacyMultiByte, unicode } from './fixtures/encodings
77

88
const fixedPRG = keccakprg() // We don't add any entropy, so it spills out predicatable results
99

10+
const slowEngine =
11+
process.env.EXODUS_TEST_PLATFORM === 'quickjs' ||
12+
process.env.EXODUS_TEST_PLATFORM === 'xs' ||
13+
process.env.EXODUS_TEST_PLATFORM === 'boa' ||
14+
process.env.EXODUS_TEST_PLATFORM === 'graaljs' ||
15+
process.env.EXODUS_TEST_PLATFORM === 'engine262'
16+
1017
// 128 buffers of increasing not-always-even lengths, 184 KiB
18+
const poolSize = slowEngine ? 48 : 128
1119
const seeds = []
12-
for (let i = 1; i <= 128; i++) seeds.push(fixedPRG.randomBytes(23 * i))
20+
for (let i = 1; i <= poolSize; i++) seeds.push(fixedPRG.randomBytes(23 * i))
1321
const rand = () => fixedPRG.randomBytes(1)[0] / 256 // or Math.random()
1422

1523
const isConsistenFatalEncoding = (label) => legacySingleByte.includes(label) || label === 'utf-8' // see explanation below

tests/wif.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test('toWifString matches wif, random data', async (t) => {
6363
}
6464
})
6565

66-
test('sizes roundtrip, random data', async (t) => {
66+
test('sizes roundtrip, random data', { timeout: 60_000 }, async (t) => {
6767
const seed = randomValues(300)
6868
for (const compressed of [false, true]) {
6969
for (const version of [0, 1, 10, 42, 255]) {

0 commit comments

Comments
 (0)