[py-dev] py.test --looponfailing started failing on Windows...

holger krekel holger at merlinux.de
Sat Jul 5 11:01:39 CEST 2008


On Sat, Jul 05, 2008 at 10:49 +0200, Baptiste Lepilleur wrote:
> I managed to find where the readfrom code was. I added trace to the exec_net.Message class and it show that the initial 0x00 bytes is not recieved in readfrom.
> 
> * writeto:
> header = (3, 1, 3, 0)
> Length: 12, Binary: 0x['00', '03', '00', '01', '00', '00', '00', '03', '00', '00', '00', '00']
> 
> * readfrom:
> header = (768, 256, 768, 0)
> Length: 12, Binary: 0x['03', '00', '01', '00', '00', '00', '03', '00', '00', '00', '00', '00']

doesn't this look like a network versus host byte order issue?
Can't imagine how this will only sometimes happen, though. 

i am soon leaving for EP2008 so cannot dig deeper for now. 
let me know about any more observations. 

thanks & best, 

holger


> Now, were it gets weird is that I can get py.test -f working by adding the traces. I definetly get some non determinist behaviour there. The bug may be caused by some race condition that somehow has become more likely to occur.
> 
> Another stuff that I don't understand: 
> I copied the mecanism from gateway.py to declare the "log" (the debug variable), and if the "log" variable is also named debug, then on the slave side, both message and gateway traces end-up in the message "log". The gateway log is created but never written into. Is it caused by the "magic" that send python code to the slave ?
> 
> Baptiste.
>   ----- Original Message ----- 
>   From: Baptiste Lepilleur 
>   To: py-dev at codespeak.net 
>   Sent: Saturday, July 05, 2008 10:03 AM
>   Subject: [py-dev] py.test --looponfailing started failing on Windows...
> 
> 
>   I'm stuck with this weird issue. py.test -f has worked perfectly for more than one month, but yesterday I got my first failure as shown below. The weird thing is that it restarted worked fine after failing a few times, but this morning it is impossible to get it working...
> 
>   Environment: Python 2.5.2 on Windows XP SP3 32 bits and py-0.9.1 install via setup.py.
> 
>   Below are the failure output when I start py.test -f, and the debug ouput of the gateway trace that I enabled. Anyone know how to get useful information about the remote exception (like source code... to help understand where this ValueError come from ?)
> 
>   I tried to run the gateway unit test, but they always get stuck. The strange thing is that it seems to be depend on how they are started with py.test: 
>   If I starts the test with disabled stdout capture (py.test -v -s) , then the test remain stuck on:
>    test_gateway.py:91   TestPopenGateway().test_correct_setup_no_py,
>   If I starts the test normally (py.test -v), then test run go farther but get stuck on:
>   test_gateway.py:405  TestPopenGateway().test_chdir_separation
>   Gateway debug trace for unit test do not show any ValueError exception...
>   Unit tests output is at the end of the mail.
> 
>   Any help to understand where I should add traces in the code to understand what is going on would be greatly appreciated.
> 
>   Thanks,
>   Baptiste.
> 
>   * The failure:
>   E:\prg\py\App\sbuilder\build\src\sbuilder\testing>py.test.py  -f
>   * opening PopenGateway:  C:\Python25\python.exe
>   MASTER: initiated slave terminal session ->
>   MASTER: send start info, topdir=E:\prg\py\App\sbuilder\build\src
>   Traceback (most recent call last):
>     File "E:\prg\py\App\sbuilder\build\src\sbuilder\testing\py.test.py", line 4, in <module>
>       py.test.cmdline.main()
>     File "c:\Python25\lib\site-packages\py\test\cmdline.py", line 15, in main
>       failures = session.main()
>     File "C:\Python25\lib\site-packages\py\test\terminal\remote.py", line 82, in main
>       failures = self.run_remote_session(failures)
>     File "C:\Python25\lib\site-packages\py\test\terminal\remote.py", line 111, in run_remote_session
>       return channel.receive()
>     File "C:\Python25\lib\site-packages\py\execnet\channel.py", line 175, in receive
>       raise self._getremoteerror() or EOFError()
>   EOFError
> 
>   I enabled the gateway trace I found:
>   **** execnet-debug-3420:
>   sending gateway bootstrap code
>   Channel(3).__del__
>   sent -> <Message.CHANNEL_LAST_MESSAGE channelid=3 ''>
>   Channel(5).__del__
>   sent -> <Message.CHANNEL_LAST_MESSAGE channelid=5 ''>
>   sent -> <Message.CHANNEL_OPEN channelid=1 len=111>
>   sent -> <Message.CHANNEL_DATA channelid=1 len=456>
>   leaving <Thread(receiver, started daemon)>
>   ====================cleaning up====================
>   Channel(1).__del__
> 
> 
>   *** execnet-debug-2308 
>   Traceback (most recent call last):
>     File "<string>", line 359, in _thread_receiver
>     File "<string>", line 626, in readfrom
>   ValueError: bad data format
> 
>   leaving <Thread(receiver, started daemon)>
>   _servemain finished
>   ====================cleaning up====================
> 
> 
>   *** Results of running the unit tests for exec_net module
>   C:\Python25\Lib\site-packages\py\execnet\testing>python c:\Python25\Lib\site-packages\py\bin\py.test -v
>   inserting into sys.path: C:\Python25\Lib\site-packages
>   ============================= test process starts =============================
>   executable:   c:\Python25\python.exe  (2.5.2-final-0)
>   using py lib: C:\Python25\Lib\site-packages\py <rev unknown>
>   test target:  C:\Python25\Lib\site-packages\py\execnet\testing
>   initial conf 0: C:\Python25\Lib\site-packages\py\test\defaultconftest.pyc
>   initial conf 1: C:\Python25\Lib\site-packages\py\conftest.pyc
> 
> 
>   + testmodule: C:\Python25\Lib\site-packages\py\execnet\testing\test_gateway.py
>   register.py:20       test_getsource_import_modules[0] ok (0.00)
>   register.py:20       test_getsource_import_modules[1] ok (0.00)
>   register.py:20       test_getsource_import_modules[2] ok (0.00)
>   register.py:20       test_getsource_import_modules[3] ok (0.00)
>   register.py:20       test_getsource_import_modules[4] ok (0.00)
>   test_gateway.py:17   test_getsource_no_colision ok (0.00)
>   test_gateway.py:30   test_stdouterrin_setnull ok (0.02)
>   test_gateway.py:45   TestMessage().test_wire_protocol ok (0.00)
>   test_gateway.py:61   TestPureChannel().test_factory_create ok (0.00)
>   test_gateway.py:67   TestPureChannel().test_factory_getitem ok (0.00)
>   test_gateway.py:73   TestPureChannel().test_channel_timeouterror ok (0.02)
>   test_gateway.py:85   TestPopenGateway().test_correct_setup ok (0.08)
>   test_gateway.py:88   TestPopenGateway().test_repr_doesnt_crash ok (0.00)
>   test_gateway.py:91   TestPopenGateway().test_correct_setup_no_py ok (0.02)
>   test_gateway.py:100  TestPopenGateway().test_remote_exec_waitclose ok (0.00)
>   test_gateway.py:104  TestPopenGateway().test_remote_exec_waitclose_2 ok (0.00)
>   test_gateway.py:108  TestPopenGateway().test_remote_exec_waitclose_noarg ok (0.00)
>   test_gateway.py:112  TestPopenGateway().test_remote_exec_error_after_close ok (0.00)
>   test_gateway.py:117  TestPopenGateway().test_remote_exec_channel_anonymous ok (0.00)
>   test_gateway.py:126  TestPopenGateway().test_channel_close_and_then_receive_error ok (0.00)
>   test_gateway.py:130  TestPopenGateway().test_channel_finish_and_then_EOFError ok (0.00)
>   test_gateway.py:138  TestPopenGateway().test_channel_close_and_then_receive_error_multiple ok (0.00)
> 
>   test_gateway.py:144  TestPopenGateway().test_channel__local_close ok (0.00)
>   test_gateway.py:149  TestPopenGateway().test_channel__local_close_error ok (0.00)
>   test_gateway.py:155  TestPopenGateway().test_channel_error_reporting ok (0.00)
>   test_gateway.py:166  TestPopenGateway().test_channel_syntax_error ok (0.00)
>   test_gateway.py:175  TestPopenGateway().test_channel_iter ok (0.00)
>   test_gateway.py:183  TestPopenGateway().test_channel_passing_over_channel ok (0.00)
>   test_gateway.py:202  TestPopenGateway().test_channel_receiver_callback ok (0.00)
>   test_gateway.py:217  TestPopenGateway().test_channel_callback_after_receive ok (0.02)
>   test_gateway.py:233  TestPopenGateway().test_waiting_for_callbacks ok (0.22)
>   test_gateway.py:245  TestPopenGateway().test_channel_callback_stays_active ok (0.75)
>   test_gateway.py:275  TestPopenGateway().test_channel_callback_remote_freed ok (0.75)
>   test_gateway.py:279  TestPopenGateway().test_channel_endmarker_callback ok (0.00)
>   test_gateway.py:294  TestPopenGateway().test_remote_redirect_stdout ok (0.00)
>   test_gateway.py:303  TestPopenGateway().test_remote_exec_redirect_multi ok (0.00)
>   test_gateway.py:318  TestPopenGateway().test_channel_file ok (0.00)
>   test_gateway.py:330  TestPopenGateway().test_channel_file_write_error ok (0.00)
>   test_gateway.py:336  TestPopenGateway().test_channel_file_proxyclose ok (0.02)
>   test_gateway.py:347  TestPopenGateway().test_confusion_from_os_write_stdout ok (0.00)
>   test_gateway.py:361  TestPopenGateway().test_confusion_from_os_write_stderr ok (0.00)
>   test_gateway.py:375  TestPopenGateway().test_non_reverse_execution ok (0.03)
>   test_gateway.py:405  TestPopenGateway().test_chdir_separation ^C
>   C:\Python25\Lib\site-packages\py\execnet\testing>
> 
>   ---
>   Baptiste Lepilleur <blep at users.sourceforge.net>
> 
> 
> 
> ------------------------------------------------------------------------------
> 
> 
>   _______________________________________________
>   py-dev mailing list
>   py-dev at codespeak.net
>   http://codespeak.net/mailman/listinfo/py-dev

> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev


-- 
collaborative expert contracting: http://merlinux.eu 
pylib py.test/greenlets/svn APIs: http://pylib.org 
PyPy  Python/Compiler tool chain: http://codespeak.net/pypy 



More information about the Pytest-dev mailing list