Skip to content

Commit

Permalink
test: Add graylistThreshold to test orbiter.
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenyoung committed Oct 31, 2024
1 parent 0d1031d commit 91cdfab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions test/stress-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand All @@ -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) => {
Expand All @@ -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()

Expand Down
5 changes: 4 additions & 1 deletion test/utils/test-config/orbiter-libp2p-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const Libp2pOptions = {
services: {
identify: identify(),
pubsub: gossipsub({
emitSelf: true
emitSelf: true,
scoreThresholds: {
graylistThreshold: -80000000000
}
})
}
}
Expand Down

0 comments on commit 91cdfab

Please sign in to comment.