-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
In my code, I have:
await b.suite(
`Random reads from table with 10M rows`,
b.add('case 1', async () => {
const hostname = await setupServerA({rows: 10_000_000})
return async () => {
const id = Math.floor(Math.random() * 10_000_000)
const query = `SELECT * FROM randoms WHERE id = ${id}`
await doQuery(`${hostname}/query`, query)
}
}),
b.add('case 2', async () => {
const hostname = await setupServerB({rows: 10_000_000})
return async () => {
const id = Math.floor(Math.random() * 10_000_000)
const query = `SELECT * FROM randoms WHERE id = ${id}`
await doQuery(`${hostname}/query`, query)
}
}),
b.cycle(),
b.complete()
)What I'm noticing is that setupServerA and setupServerB are getting called twice each, straight away. I previously was making some assumptions that only one server would be active at once which got me tripped up, but even after I fixed it the fact that the setups are all booting at the same time is causing some problems.
What's the reasoning behind calling each setup twice? Is that configurable? Additionally, could each async setup stage be executed sequentially rather than in parallel?
Thanks for building a really useful little tool!
Metadata
Metadata
Assignees
Labels
No labels