fix: e2e test error
@@ -607,10 +607,16 @@ class Cluster {
async _reservePorts() {
const [wsPort, ...workerPorts] = await Promise.all([
portfinder.getPortPromise({ port: 9944 }),
- ...this.workers.map(() => portfinder.getPortPromise({ port: 8000, stopPort: 9900 }))
+ ...this.workers.map(() => [
+ portfinder.getPortPromise({ port: 8000, stopPort: 9900 }), // port
+ portfinder.getPortPromise({ port: 8000, stopPort: 9900 }), // port (acl)
+ ])
]);
this.wsPort = wsPort;
- this.workers.forEach((w, i) => w.port = workerPorts[i]);
+ this.workers.forEach((w, i) => {
+ console.log(`${i}-th pRuntime port: ${workerPorts[0]}, ACL port: ${workerPorts[1]}`)
+ w.port = workerPorts[i]
+ });
}
_createProcesses() {
@@ -652,7 +658,7 @@ class Cluster {
types, typeAlias
});
this.workers.forEach(w => {
- w.api = new PRuntimeApi(`http://localhost:${w.port}`);
+ w.api = new PRuntimeApi(`http://localhost:${w.port[0]}`);
})
}
@@ -706,7 +712,8 @@ function newPRuntime(teePort, tmpPath, name = 'app') {
const args = isGramine ?
[
'--cores=0', // Disable benchmark
- '--port', teePort.toString()
+ '--port', teePort[0].toString(),
+ '--port_acl', teePort[1].toString(),
] :
[
'--cores=0',
@@ -716,7 +723,7 @@ function newPRuntime(teePort, tmpPath, name = 'app') {
cwd: workDir,
env: {
...process.env,
- ROCKET_PORT: teePort.toString(),
+ ROCKET_PORT: teePort[0].toString(),
}
}
], { logPath: `${tmpPath}/${name}.log` });
@@ -729,7 +736,7 @@ function newRelayer(wsPort, teePort, tmpPath, gasAccountKey, key, name = 'relaye
`--mnemonic=${gasAccountKey}`,
`--inject-key=${key}`,
`--substrate-ws-endpoint=ws://localhost:${wsPort}`,
- `--pruntime-endpoint=http://localhost:${teePort}`,
+ `--pruntime-endpoint=http://localhost:${teePort[0]}`,
'--dev-wait-block-ms=1000',
]
], { logPath: `${tmpPath}/${name}.log` });
