python version-specific codepaths in tests
Martin Pool
mbp at canonical.com
Fri Nov 20 07:10:08 GMT 2009
2009/11/20 Gordon Tyler <gordon at doxxx.net>:
> Gordon Tyler wrote:
>> John Arbash Meinel wrote:
>>> I would make sure it works first. If SIGTERM is built on
>>> TerminateProcess, I think it works, but I'd want to make sure it doesn't
>>> kill the testing process.
>>
>> I've been using it this evening while adding a test for bzr serve. All
>> the bzr serve tests seem to work fine on win32. Haven't tested it on
>> non-win32 yet.
>>
>> There is a wee snag though: the tests which make use of
>> finish_bzr_subprocess' signalling capability use SIGINT, to simulate a
>> user pressing Ctrl-C I'm guessing. The Win32 implementation of
>> Popen.send_signal only allows SIGTERM. I could make it translate SIGINT
>> to SIGTERM but that changes bzr's output (no 'bzr: interrupted'). I'm
>> wondering if it's important enough to simulate user interruption in
>> those cases or if it's acceptable to use SIGTERM in those tests instead.
>
> I've pushed my changes up to lp:~doxxx/bzr/tests-win32-signals. Some of
> the 'bzr serve' tests are broken on non-win32 because when SIGTERM'd
> their retcode is -15, not 1 as it is on win32. Not sure what to do about
> this. Could use retcode=None to ignore the retcode...
I think if the conceptually similar test is expected to cause
different behaviour on different platforms, the tests should reflect
that - ie on Unix, send SIGINT and expect clean shutdown; on Win32
send SIGTERM and expect abrupt shutdown. At least that would seem
closest to the current behaviour.)
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list