fixed all insert tests

This commit is contained in:
Kevin Jahns
2017-10-26 14:40:21 +02:00
parent 9d1ad8cb28
commit e8170a09a7
4 changed files with 37 additions and 27 deletions

View File

@@ -248,8 +248,6 @@ export function wait (t) {
export async function applyRandomTests (t, mods, iterations) {
const chance = new Chance(t.getSeed() * 1000000000)
// TODO: remove
console.info('seed: ' + t._seed)
var initInformation = await initArrays(t, { users: 5, chance: chance })
let { users } = initInformation
for (var i = 0; i < iterations; i++) {

View File

@@ -14,8 +14,15 @@ export class TestRoom {
this.users.set(userID, connector)
for (let [uid, user] of this.users) {
if (uid !== userID && (user.role === 'master' || connector.role === 'master')) {
connector.userJoined(uid, user.role)
user.userJoined(userID, connector.role)
// The order is important because there is no timeout in send/receiveMessage
// (the user that receives a sync step must already now about the sender)
if (user.role === 'master') {
connector.userJoined(uid, user.role)
user.userJoined(userID, connector.role)
} else if (connector.role === 'master') {
user.userJoined(userID, connector.role)
connector.userJoined(uid, user.role)
}
}
}
}