Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 79ab6b4

Browse files
authored
Clean event queue after each case. (#398)
Case "Send a message to a remote endpoint should be resolved" fails sometimes during check in test and nightly test. It's probably cased by signaling messages for last case don't get flushed in time. This change gives signaling server a chance to send out all messages before the next case.
1 parent 9a3a63a commit 79ab6b4

File tree

1 file changed

+8
-3
lines changed
  • test/unit/resources/scripts

1 file changed

+8
-3
lines changed

test/unit/resources/scripts/p2p.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ describe('Unit tests for P2PClient', function() {
105105
'user2'), p2pclient3.connect('user3')])).to.be.fulfilled.and.notify(
106106
done);
107107
});
108+
afterEach((done) => {
109+
setTimeout(() => {
110+
done();
111+
}, 0);
112+
});
108113
it('Publish a valid stream to remote endpoint then stop the publication should be resolved.', done => {
109114
p2pclient1.publish('user2', localStream).then(publication=>{
110115
p2pclient1.getStats('user2').then((stats)=>{
@@ -126,18 +131,18 @@ describe('Unit tests for P2PClient', function() {
126131
expect(p2pclient3.publish('user1', localStream)).to.be.rejected.and.notify(
127132
done);
128133
});
129-
it('Send message to a remote endpoint should be resolved.', done => {
134+
it('Send a message to a remote endpoint should be resolved.', done => {
130135
expect(p2pclient1.send('user2', 'message')).to.be.fulfilled.and.notify(
131136
done);
132137
});
133138
it(
134-
'Send message to a remote endpoint not listed in local allowedRemoteIds should be rejected.',
139+
'Send a message to a remote endpoint not listed in local allowedRemoteIds should be rejected.',
135140
done => {
136141
expect(p2pclient1.send('user3', 'message')).to.be.rejected.and.notify(
137142
done);
138143
});
139144
it(
140-
'Send message to a remote endpoint not listed in remote allowedRemoteIds should be rejected.',
145+
'Send a message to a remote endpoint not listed in remote allowedRemoteIds should be rejected.',
141146
done => {
142147
expect(p2pclient3.send('user1', 'message')).to.be.rejected.and.notify(
143148
done);

0 commit comments

Comments
 (0)