|
38 | 38 | from pymongo.uri_parser import parse_uri
|
39 | 39 | from test import unittest, IntegrationTest
|
40 | 40 | from test.utils import (assertion_context,
|
| 41 | + cdecimal_patched, |
41 | 42 | client_context,
|
42 | 43 | Barrier,
|
43 | 44 | get_pool,
|
@@ -334,6 +335,15 @@ def marked_unknown(e):
|
334 | 335 | event_type = getattr(monitoring, event)
|
335 | 336 | return self.pool_listener.event_count(event_type)
|
336 | 337 |
|
| 338 | + def maybe_skip_scenario(self, test): |
| 339 | + """Override to skip threaded tests when cdecimal is installed on 2.7 |
| 340 | + """ |
| 341 | + super(TestIntegration, self).maybe_skip_scenario(test) |
| 342 | + # PYTHON-2332 |
| 343 | + ops = [op['name'] for op in test['operations']] |
| 344 | + if cdecimal_patched() and 'startThread' in ops: |
| 345 | + raise unittest.SkipTest('PYTHON-2332 test fails with cdecimal') |
| 346 | + |
337 | 347 | def assert_event_count(self, event, count):
|
338 | 348 | """Run the assertEventCount test operation.
|
339 | 349 |
|
@@ -400,9 +410,11 @@ def wait_for_thread(self, name):
|
400 | 410 | """Run the 'waitForThread' operation."""
|
401 | 411 | thread = self.targets[name]
|
402 | 412 | thread.stop()
|
403 |
| - thread.join() |
| 413 | + thread.join(60) |
404 | 414 | if thread.exc:
|
405 | 415 | raise thread.exc
|
| 416 | + self.assertFalse( |
| 417 | + thread.is_alive(), 'Thread %s is still running' % (name,)) |
406 | 418 |
|
407 | 419 |
|
408 | 420 | def create_spec_test(scenario_def, test, name):
|
|
0 commit comments