35
35
ClientMetadataTestingServiceInterface ,
36
36
TestingServiceInterface ,
37
37
)
38
+ from testing .thrift_types import easy as Python_easy
38
39
from testing .types import Color , easy , HardError
40
+ from thrift .lib .py3 .test .auto_migrate .auto_migrate_util import brokenInAutoMigrate
39
41
from thrift .py3 .client import ClientType , get_client
40
42
from thrift .py3 .common import Priority , Protocol , RpcOptions
41
43
from thrift .py3 .exceptions import ApplicationError
@@ -139,6 +141,7 @@ class ClientServerTests(unittest.TestCase):
139
141
These are tests where a client and server talk to each other
140
142
"""
141
143
144
+ @brokenInAutoMigrate ()
142
145
# pyre-fixme[56]: Argument `sys.version_info[slice(None, 2, None)] < (3, 7)` to
143
146
# decorator factory `unittest.skipIf` could not be resolved in a global scope.
144
147
@unittest .skipIf (sys .version_info [:2 ] < (3 , 7 ), "Requires py3.7" )
@@ -180,6 +183,7 @@ async def outside_context_test() -> None:
180
183
181
184
loop .run_until_complete (outside_context_test ())
182
185
186
+ @brokenInAutoMigrate ()
183
187
def test_rpc_headers (self ) -> None :
184
188
loop = asyncio .get_event_loop ()
185
189
@@ -195,6 +199,7 @@ async def inner_test() -> None:
195
199
196
200
loop .run_until_complete (inner_test ())
197
201
202
+ @brokenInAutoMigrate ()
198
203
def test_client_resolve (self ) -> None :
199
204
loop = asyncio .get_event_loop ()
200
205
hostname = socket .gethostname ()
@@ -212,6 +217,7 @@ async def inner_test() -> None:
212
217
213
218
loop .run_until_complete (inner_test ())
214
219
220
+ @brokenInAutoMigrate ()
215
221
def test_unframed_binary (self ) -> None :
216
222
loop = asyncio .get_event_loop ()
217
223
@@ -231,6 +237,7 @@ async def inner_test() -> None:
231
237
232
238
loop .run_until_complete (inner_test ())
233
239
240
+ @brokenInAutoMigrate ()
234
241
def test_framed_deprecated (self ) -> None :
235
242
loop = asyncio .get_event_loop ()
236
243
@@ -249,6 +256,7 @@ async def inner_test() -> None:
249
256
250
257
loop .run_until_complete (inner_test ())
251
258
259
+ @brokenInAutoMigrate ()
252
260
def test_framed_compact (self ) -> None :
253
261
loop = asyncio .get_event_loop ()
254
262
@@ -267,6 +275,7 @@ async def inner_test() -> None:
267
275
268
276
loop .run_until_complete (inner_test ())
269
277
278
+ @brokenInAutoMigrate ()
270
279
def test_server_localhost (self ) -> None :
271
280
loop = asyncio .get_event_loop ()
272
281
@@ -280,6 +289,7 @@ async def inner_test() -> None:
280
289
281
290
loop .run_until_complete (inner_test ())
282
291
292
+ @brokenInAutoMigrate ()
283
293
def test_unix_socket (self ) -> None :
284
294
loop = asyncio .get_event_loop ()
285
295
@@ -293,6 +303,7 @@ async def inner_test(dir: Path) -> None:
293
303
with tempfile .TemporaryDirectory () as tdir :
294
304
loop .run_until_complete (inner_test (Path (tdir )))
295
305
306
+ @brokenInAutoMigrate ()
296
307
def test_no_client_aexit (self ) -> None :
297
308
loop = asyncio .get_event_loop ()
298
309
@@ -309,6 +320,7 @@ async def inner_test() -> None:
309
320
310
321
loop .run_until_complete (inner_test ())
311
322
323
+ @brokenInAutoMigrate ()
312
324
def test_client_aexit_no_await (self ) -> None :
313
325
"""
314
326
This actually handles the case if __aexit__ is not awaited
@@ -330,6 +342,7 @@ async def inner_test() -> None:
330
342
331
343
loop .run_until_complete (inner_test ())
332
344
345
+ @brokenInAutoMigrate ()
333
346
def test_no_client_no_aenter (self ) -> None :
334
347
"""
335
348
This covers if aenter was canceled since those two are the same really
@@ -346,6 +359,7 @@ async def inner_test() -> None:
346
359
347
360
loop .run_until_complete (inner_test ())
348
361
362
+ @brokenInAutoMigrate ()
349
363
def test_derived_service (self ) -> None :
350
364
"""
351
365
This tests calling methods from a derived service
@@ -366,21 +380,7 @@ async def inner_test() -> None:
366
380
367
381
loop .run_until_complete (inner_test ())
368
382
369
- def test_non_utf8_exception_message (self ) -> None :
370
- loop = asyncio .get_event_loop ()
371
-
372
- async def inner_test () -> None :
373
- async with TestServer (handler = CppHandler ()) as sa :
374
- ip , port = sa .ip , sa .port
375
- assert ip and port
376
- async with get_client (TestingService , host = ip , port = port ) as client :
377
- with self .assertRaises (HardError ):
378
- await client .hard_error (True )
379
- with self .assertRaises (UnicodeDecodeError ):
380
- await client .hard_error (False )
381
-
382
- loop .run_until_complete (inner_test ())
383
-
383
+ @brokenInAutoMigrate ()
384
384
def test_renamed_func (self ) -> None :
385
385
loop = asyncio .get_event_loop ()
386
386
@@ -393,6 +393,7 @@ async def inner_test() -> None:
393
393
394
394
loop .run_until_complete (inner_test ())
395
395
396
+ @brokenInAutoMigrate ()
396
397
def test_queue_timeout (self ) -> None :
397
398
"""
398
399
This tests whether queue timeout functions properly.
@@ -435,6 +436,7 @@ async def clients_run(server: TestServer) -> None:
435
436
436
437
loop .run_until_complete (clients_run (testing ))
437
438
439
+ @brokenInAutoMigrate ()
438
440
def test_cancelled_task (self ) -> None :
439
441
"""
440
442
This tests whether cancelled tasks are handled properly.
@@ -463,6 +465,7 @@ async def inner_test() -> None:
463
465
464
466
loop .run_until_complete (inner_test ())
465
467
468
+ @brokenInAutoMigrate ()
466
469
def test_request_with_default_rpc_options (self ) -> None :
467
470
loop = asyncio .get_event_loop ()
468
471
@@ -478,6 +481,7 @@ async def inner_test() -> None:
478
481
479
482
loop .run_until_complete (inner_test ())
480
483
484
+ @brokenInAutoMigrate ()
481
485
def test_request_with_specified_rpc_options (self ) -> None :
482
486
loop = asyncio .get_event_loop ()
483
487
@@ -497,6 +501,22 @@ async def inner_test() -> None:
497
501
loop .run_until_complete (inner_test ())
498
502
499
503
504
+ class Utf8Test (unittest .IsolatedAsyncioTestCase ):
505
+ @brokenInAutoMigrate ()
506
+ async def test_non_utf8_exception_message (self ) -> None :
507
+ # something about non-utf8 exceptions seems extra broken, I need to skip the test entirely
508
+ if Python_easy is easy :
509
+ self .assertTrue (False )
510
+ async with TestServer (handler = CppHandler ()) as sa :
511
+ ip , port = sa .ip , sa .port
512
+ assert ip and port
513
+ async with get_client (TestingService , host = ip , port = port ) as client :
514
+ with self .assertRaises (HardError ):
515
+ await client .hard_error (True )
516
+ with self .assertRaises (UnicodeDecodeError ):
517
+ await client .hard_error (False )
518
+
519
+
500
520
class StackHandler (StackServiceInterface ):
501
521
async def add_to (self , lst : Sequence [int ], value : int ) -> Sequence [int ]:
502
522
return [x + value for x in lst ]
@@ -532,6 +552,7 @@ class ClientStackServerTests(unittest.TestCase):
532
552
These are tests where a client and server(stack_arguments) talk to each other
533
553
"""
534
554
555
+ @brokenInAutoMigrate ()
535
556
def test_server_localhost (self ) -> None :
536
557
loop = asyncio .get_event_loop ()
537
558
@@ -576,6 +597,7 @@ async def getMetadaField(self, key: str) -> str:
576
597
577
598
578
599
class ClientMetadataTestingServiceTests (unittest .TestCase ):
600
+ @brokenInAutoMigrate ()
579
601
def test_client_metadata (self ) -> None :
580
602
loop = asyncio .get_event_loop ()
581
603
hostname : str = socket .gethostname ()
@@ -606,6 +628,7 @@ async def inner_test() -> None:
606
628
607
629
loop .run_until_complete (inner_test ())
608
630
631
+ @brokenInAutoMigrate ()
609
632
def test_call_get_metadata_field_with_invalid_key_should_return_empty_field (
610
633
self ,
611
634
) -> None :
0 commit comments