Issue5696
Created on 2009-04-05 01:46 by jackdied, last changed 2009-04-07 22:34 by jackdied.
|
msg85460 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-05 01:45 |
|
The first part of my telnetlib work is testing what already is.
Attached is a patch to test_telnetlib that tests mosts of the guarantees
of the telnetlib.Telnet.read_* methods (as guaranteed by the docs, at
least).
Theoretically every test I added has a race condition.
ReadTests.blocking_timeout is currently set to 0.1 seconds and works on
my platform (it also works at 0.0 seconds). Is this acceptable or do I
need to include semaphores will 100% predictable behavior?
TIA
|
|
msg85469 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2009-04-05 09:03 |
|
FWIW, it works here too with 0.0 and 0.1 seconds (it's Linux x86).
|
|
msg85584 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-05 23:17 |
|
added some tests for testing IAC commands and SB data handling.
|
|
msg85606 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-06 02:09 |
|
committed in r71302
|
|
msg85716 - (view) |
Author: Benjamin Peterson (benjamin.peterson) |
Date: 2009-04-07 15:28 |
|
Jack, this test seems to be very flaky on the buildbots (and my
machine). I see a lot of failures like this:
======================================================================
FAIL: test_read_eager_B (test.test_telnetlib.ReadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 235, in
test_read_eager_B
self._test_read_any_eager_B('read_eager')
File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 224, in
_test_read_any_eager_B
self.assertRaises(EOFError, func)
AssertionError: EOFError not raised
======================================================================
FAIL: test_read_very_eager_B (test.test_telnetlib.ReadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 231, in
test_read_very_eager_B
self._test_read_any_eager_B('read_very_eager')
File "/temp/python/trunk/Lib/test/test_telnetlib.py", line 224, in
_test_read_any_eager_B
self.assertRaises(EOFError, func)
AssertionError: EOFError not raised
----------------------------------------------------------------------
Ran 22 tests in 76.712s
FAILED (failures=2)
test test_telnetlib failed -- errors occurred; run in verbose mode for
details
1 test failed:
test_telnetlib
|
|
msg85732 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-07 18:30 |
|
Could you try increasing self.blocking_timeout (in the _setUp function)
to something greater than 0.0 (like 0.1) and see if that works? I
picked a constant that was as small as Worked For Me to keep the total
test time as short as possible.
Unfortunately select() is called in the guts of Telnet so slipping in a
mock object is difficult. I could also add more synchronization
primitives but that is also icky. Hopefully just upping the constant a
little does the trick.
|
|
msg85736 - (view) |
Author: Benjamin Peterson (benjamin.peterson) |
Date: 2009-04-07 19:18 |
|
2009/4/7 Jack Diederich <report@bugs.python.org>:
>
> Jack Diederich <jackdied@gmail.com> added the comment:
>
> Could you try increasing self.blocking_timeout (in the _setUp function)
> to something greater than 0.0 (like 0.1) and see if that works? I
> picked a constant that was as small as Worked For Me to keep the total
> test time as short as possible.
Nope, still have the same problem.
>
> Unfortunately select() is called in the guts of Telnet so slipping in a
> mock object is difficult. I could also add more synchronization
> primitives but that is also icky. Hopefully just upping the constant a
> little does the trick.
You could monkey patch select.select() during the tests or rewrite
telnetlib, so it calls self._select() and make a subclass.
|
|
msg85744 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-07 20:23 |
|
committed some changes in r71377. This uses Queue.join() to [hopefully]
eliminate the race condidtions.
|
|
msg85751 - (view) |
Author: Benjamin Peterson (benjamin.peterson) |
Date: 2009-04-07 22:15 |
|
2009/4/7 Jack Diederich <report@bugs.python.org>:
>
> Jack Diederich <jackdied@gmail.com> added the comment:
>
> committed some changes in r71377. This uses Queue.join() to [hopefully]
> eliminate the race condidtions.
Thanks! Works like a charm now.
|
|
msg85754 - (view) |
Author: Jack Diederich (jackdied) |
Date: 2009-04-07 22:34 |
|
except when it doesn't! Still failing on some buildbots. The couple
places where it expects 1% wibble in timing is far too strict. I'm
fixing it.
|
|
| Date |
User |
Action |
Args |
| 2009-04-07 22:34:47 | jackdied | set | messages:
+ msg85754 |
| 2009-04-07 22:15:31 | benjamin.peterson | set | messages:
+ msg85751 |
| 2009-04-07 20:23:57 | jackdied | set | messages:
+ msg85744 |
| 2009-04-07 19:18:56 | benjamin.peterson | set | messages:
+ msg85736 |
| 2009-04-07 18:30:08 | jackdied | set | messages:
+ msg85732 |
| 2009-04-07 15:28:18 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages:
+ msg85716
|
| 2009-04-06 02:09:47 | jackdied | set | status: open -> closed resolution: accepted messages:
+ msg85606
|
| 2009-04-05 23:20:04 | jackdied | set | stage: patch review type: behavior components:
+ Tests versions:
+ Python 3.1, Python 2.7 |
| 2009-04-05 23:18:40 | jackdied | set | files:
- test_telnetlib.patch |
| 2009-04-05 23:18:03 | jackdied | set | files:
+ test_telnetlib.patch
messages:
+ msg85584 |
| 2009-04-05 09:03:36 | georg.brandl | set | nosy:
+ georg.brandl messages:
+ msg85469
|
| 2009-04-05 01:46:01 | jackdied | create | |
|