Two test failures on Windows.

This commit is contained in:
A. Jesse Jiryu Davis 2015-01-20 12:44:04 -05:00
parent 738c48c92c
commit 34560199ba
2 changed files with 20 additions and 7 deletions

View File

@ -16,7 +16,12 @@
import threading
from test import unittest, client_context, IntegrationTest, db_user, db_pwd
from test import (client_context,
client_knobs,
db_user,
db_pwd,
IntegrationTest,
unittest)
from test.utils import rs_or_single_client_noauth
from test.utils import frequent_thread_switches, joinall
from pymongo.errors import OperationFailure
@ -191,14 +196,18 @@ class TestThreads(IntegrationTest):
threads.extend(Disconnect(self.db.connection, 10) for _ in range(10))
with frequent_thread_switches():
for t in threads:
t.start()
# Frequent thread switches hurt performance badly enough to
# prevent reconnection within 5 seconds, especially in Python 2
# on a Windows build slave.
with client_knobs(server_wait_time=30):
for t in threads:
t.start()
for t in threads:
t.join(30)
for t in threads:
t.join(30)
for t in threads:
self.assertTrue(t.passed)
for t in threads:
self.assertTrue(t.passed)
class TestThreadsAuth(IntegrationTest):

View File

@ -20,6 +20,7 @@ sys.path[0:0] = [""]
import socket
import threading
from unittest import SkipTest
from bson.py3compat import imap
from pymongo import common
@ -575,6 +576,9 @@ class TestTopologyErrors(TopologyTest):
self.assertEqual(SERVER_TYPE.Standalone, get_type(t, 'a'))
def test_selection_failure(self):
if sys.platform == 'win32':
raise SkipTest('timing unreliable on Windows')
# While ismaster fails, ensure it's called about every 10 ms.
ismaster_count = [0]