def test_concurrentLogin(self):
        """
        Two different correct login attempts can be made on the same root
        object at the same time and produce two different resulting avatars.
        """
        self.portal.registerChecker(
            checkers.InMemoryUsernamePasswordDatabaseDontUse(
                foo=b'bar', baz=b'quux'))

        firstLogin = self.clientFactory.login(
            credentials.UsernamePassword(b'foo', b'bar'), "BRAINS!")
        secondLogin = self.clientFactory.login(
            credentials.UsernamePassword(b'baz', b'quux'), "BRAINS!")
        d = gatherResults([firstLogin, secondLogin])
        def cbLoggedIn(result):
            (first, second) = result
            return gatherResults([
                    first.callRemote('getAvatarId'),
                    second.callRemote('getAvatarId')])
        d.addCallback(cbLoggedIn)
        def cbAvatarIds(x):
            first, second = x
            self.assertEqual(first, b'foo')
            self.assertEqual(second, b'baz')
        d.addCallback(cbAvatarIds)

        self.establishClientAndServer()
        self.pump.flush()

        return d

        Two different correct login attempts can be made on the same root
        object at the same time and produce two different resulting avatars.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py