[Seaside-dev] WAPlatformTest>>testTerminate

Julian Fitzell jfitzell at gmail.com
Wed Apr 22 08:17:55 UTC 2009


On Tue, Apr 21, 2009 at 11:48 PM, Philippe Marschall
<philippe.marschall at gmail.com> wrote:
> 2009/4/22 Michael Lucas-Smith <mlucas-smith at cincom.com>:
>> Neat test,
>>
>> However, when a process is terminated in VisualWorks and it catches the
>> termination with an ensure: or ifCurtailed or something else, it is not
>> guaranteed that the ensure code will run before the process doing the
>> terminating will run.
>>
>> There are two things you can do here:
>> a) Add another semaphore in to wait until the ensure has run - but this
>> might defeat the purpose
>> b) Set the priority of the process you're testing to be higher than the
>> running process, eg:
>>   process priority: Processor activeProcess priority + 1.
>
> That relies on explicit knowledge about implementation details about
> the scheduler. I find that quite brittle.

It sounds like (a) would be fine? I don't think we necessarily care
about the order, just that it is eventually run.

Julian


More information about the seaside-dev mailing list