[ 
https://issues.apache.org/jira/browse/GROOVY-12572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134524#comment-18134524
 ] 

ASF GitHub Bot commented on GROOVY-12572:
-----------------------------------------

codeconsole opened a new pull request, #3100:
URL: https://github.com/apache/groovy/pull/3100

   Some concurrency tests slept for a fixed time to let another thread get 
somewhere first, and failed on a loaded machine. They now wait for that state 
instead. For example, `BroadcastChannelAsPublisherTest.forAwaitOverPublisher` 
waits until the consumer has subscribed before it sends, and 
`AgentChangesTest.forAwaitOverChanges` waits until the consumer's `subscribe` 
call has returned. Likewise `BroadcastChannelTest`, `ActorTest`, 
`ChannelSelectTest` and, in `groovy-http-builder`, 
`MultiExchangeTickerEndToEndTest`.
   
   Three tests that need another thread to keep to a schedule no longer fail 
when it starts late: `ActorTest.testScheduleAtFixedRateFiresRepeatedly` waits 
for three ticks instead of counting them in 300 ms, the slow server of 
`AsyncAwaitSpecTest.testFastestServer` sleeps 5 seconds instead of 200 ms, and 
`ChannelSelectTest.testTimerCreatedOnceIsAFixedDeadlineAcrossSelects` starts 
its timer once the producer runs. Each change was checked by forcing the lost 
race with an injected delay. Test code only.
   
   The `groovy.concurrent` tests and `AsyncAwaitSpecTest` (296) and the 
`groovy-http-builder` tests (78) pass, as do the Checkstyle and CodeNarc gates.
   




> Concurrency tests fail on a loaded machine because they sleep instead of 
> waiting for a state
> --------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12572
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12572
>             Project: Groovy
>          Issue Type: Test
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> Several tests sleep for a fixed time and assume another thread has reached 
> some state, or need a thread to keep to a tight schedule; on a loaded machine 
> they fail. For example, 
> {{BroadcastChannelAsPublisherTest.forAwaitOverPublisher}} fails with 
> "BroadcastChannel is closed" when the consumer subscribes after the producer 
> has sent and closed. Affected: {{BroadcastChannelAsPublisherTest}}, 
> {{AgentChangesTest}}, {{BroadcastChannelTest}}, {{ActorTest}}, 
> {{ChannelSelectTest}}, {{AsyncAwaitSpecTest.testFastestServer}} and 
> {{groovy-http-builder}}'s {{MultiExchangeTickerEndToEndTest}}. Each can be 
> made to fail by delaying the other thread.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to