From 91cdfab79c5295134a41fb387c1e2d6a50ff247f Mon Sep 17 00:00:00 2001 From: Hayden Young Date: Thu, 31 Oct 2024 23:21:25 +0000 Subject: [PATCH] test: Add graylistThreshold to test orbiter. --- test/stress-test.js | 11 ++++++----- test/utils/test-config/orbiter-libp2p-config.js | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/stress-test.js b/test/stress-test.js index afdb1c1..439e6ae 100644 --- a/test/stress-test.js +++ b/test/stress-test.js @@ -35,13 +35,13 @@ describe('End-to-End Browser Tests', function () { await rimraf('./orbiter3') }) - it.only('pin and replicate a database - lander1->orbiter1(nodejs)->orbiter2(nodejs)->lander2', async function () { + it('pin and replicate a database - lander1->orbiter1(nodejs)->orbiter2(nodejs)->lander2', async function () { const rounds = 50 const entryAmount = 100 const addr = orbiter.orbitdb.ipfs.libp2p.getMultiaddrs().shift() - console.log('start', addr) - for (let k = 1; k <= rounds; k++) { + console.log("start", addr) + for (let k = 1; k <= rounds; k ++) { let replicated = false // lander1 = await launchLander({ orbiterAddress: orbiterAddress1, directory: 'lander4' }) @@ -68,13 +68,14 @@ describe('End-to-End Browser Tests', function () { await orbiter.auth.add(lander2.orbitdb.identity.id) // lander2 = await launchLander({ orbiterAddress: orbiterAddress1, directory: 'lander5' }) + // console.time('pin2') // await lander2.pin(db1.address) // console.timeEnd('pin2') // console.time('replicate') // console.log("open", db1.address) - console.time('round ' + k + '/' + rounds) + console.time('round ' + k + "/" + rounds) const db2 = await lander2.orbitdb.open(db1.address) const onConnected = (peerId, heads) => { @@ -85,7 +86,7 @@ describe('End-to-End Browser Tests', function () { await waitFor(() => replicated, () => true) // console.timeEnd('replicate') - console.timeEnd('round ' + k + '/' + rounds) + console.timeEnd('round ' + k + "/" + rounds) const res = await db2.all() diff --git a/test/utils/test-config/orbiter-libp2p-config.js b/test/utils/test-config/orbiter-libp2p-config.js index dd6faf7..0ceacf9 100644 --- a/test/utils/test-config/orbiter-libp2p-config.js +++ b/test/utils/test-config/orbiter-libp2p-config.js @@ -32,7 +32,10 @@ const Libp2pOptions = { services: { identify: identify(), pubsub: gossipsub({ - emitSelf: true + emitSelf: true, + scoreThresholds: { + graylistThreshold: -80000000000 + } }) } }