Skip to content

Commit

Permalink
fix port conflicts in kinto e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless-eth committed May 30, 2024
1 parent 27aef2f commit 2155f7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions test/kinto-e2e/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ const main = async () => {

const failedOps: OpInfoType[] = []

const chunkSize = 50
const totalOps = 200
const chunkSize = 25
const totalOps = 800
let processed = 0

while (userOperationEvents.length > 0) {
Expand Down Expand Up @@ -194,12 +194,19 @@ const main = async () => {
let anvilIdCounter = 0
let altoPortCounter = 4337

const inputStream = filteredOpInfo.map(async (opInfo) => {
const portNumbers = Array.from({ length: filteredOpInfo.length }, () => ({
anvilId: anvilIdCounter++,
altoPort: altoPortCounter++
}))

const inputStream = filteredOpInfo.map(async (opInfo, index) => {
try {
const { anvilId, altoPort } = portNumbers[index]

const canReplay = await canReplayUserOperation({
anvilPool,
anvilId: anvilIdCounter++,
altoPort: altoPortCounter++,
anvilId,
altoPort,
opInfo
})

Expand Down
4 changes: 2 additions & 2 deletions test/kinto-e2e/src/setupAlto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const startAlto = async (rpc: string, altoPort: string) => {
const alto = spawn(command, args, options)

// [USE FOR DEBUGGING]
//alto.stdout.on("data", (data) => console.log(data.toString()))
//alto.stderr.on("data", (data) => console.log(data.toString()))
// alto.stdout.on("data", (data) => console.log(data.toString()))
// alto.stderr.on("data", (data) => console.log(data.toString()))

await waitPort({
host: "127.0.0.1",
Expand Down

0 comments on commit 2155f7e

Please sign in to comment.