提交 aac668c1 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

test/test-node-sctp.js: Wait for SCTP association to be open before sending data

上级 c145341a
...@@ -85,6 +85,15 @@ beforeAll(async () => ...@@ -85,6 +85,15 @@ beforeAll(async () =>
}); });
} }
// Wait for the SCTP association to be open.
await Promise.race(
[
new Promise((resolve) => sctpSocket.on('connect', resolve)),
new Promise((resolve, reject) => (
setTimeout(() => reject(new Error('SCTP connection timeout')), 3000)
))
]);
// Create an explicit SCTP outgoing stream with id 123 (id 0 is already used // Create an explicit SCTP outgoing stream with id 123 (id 0 is already used
// by the implicit SCTP outgoing stream built-in the SCTP socket). // by the implicit SCTP outgoing stream built-in the SCTP socket).
sctpSendStreamId = 123; sctpSendStreamId = 123;
...@@ -201,4 +210,4 @@ test('ordered DataProducer delivers all SCTP messages to the DataConsumer', asyn ...@@ -201,4 +210,4 @@ test('ordered DataProducer delivers all SCTP messages to the DataConsumer', asyn
bytesSent : recvMessageBytes bytesSent : recvMessageBytes
} }
]); ]);
}, 8000); }, 10000);
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论