I think proper fix for this logic would be to disable test environment
during startup of resources

ср, 12 июн. 2019 г. в 21:11, Denis Kudriashov <dionisi...@gmail.com>:

> Hi Eric.
>
> You can override #runCaseManaged on your test case:
>
> MyTestCase>>runCaseManaged
>    self runCase
>
> It will disable all clever logic.
>
> ср, 12 июн. 2019 г. в 20:55, Erik Stel <erik.s...@gmail.com>:
>
>> Hi,
>>
>> I'm developing a web application using (amongst others) WebSockets. To
>> prevent test methods from becoming too big and slow I created a TestCase
>> with a TestResource containing my web application instance. After the
>> first
>> test method is run, the WebSocket is closed unexpectedly and
>> automagically.
>> It turns out that all forked processes are terminated when a TestCase has
>> executed a test method. What would be the proper way to prevent these
>> forked
>> processes from terminating after a single test method? Or am I missing
>> something/doing something wrong?
>>
>> TestExecutionEnvironment>>#checkForkedProcesses is responsible for
>> terminating any (non failed) processes. It is executed after
>> TestExecutionEnvironment>>#runTestCaseSafelly: [sic: this should be
>> #runTestCaseSafely:]. A possible solution might be to check whether the
>> Context in which a forked process was created has the #setUp method of a
>> TestResource of the TestCase (you still with me ;-) in its Context chain.
>> If
>> that is the case, the process is probably forked for a reason. This forked
>> process does have to be terminated when all TestCases have finished of
>> course (when the TestResource does #tearDown).
>>
>> IFF the forked processes should be kept alive during the execution of all
>> TestCase methods, does the suggested solution above seem logical or are
>> there any (better) alternatives?
>>
>> Regards,
>> Erik
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>

Reply via email to