[
https://issues.apache.org/jira/browse/HIVE-22584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16993626#comment-16993626
]
Peter Vary commented on HIVE-22584:
-----------------------------------
The {{awaitTryScheduleIfInProgress}} waits for
{{TaskExecutorServiceForTest.tryScheduleUnderLock}} to finish. The waitQueue is
updated after the {{TaskExecutorService.tryScheduleUnderLock}} called in
{{WaitQueueWorker.run}}. Since the test checks the queue size, it is flaky
(~1/1000 just to make it easy :) )
The {{TaskExecutorService.tryScheduleUnderLock}} has the annotation of
{{VisibleForTesting}} and used only in a test, and in {{WaitQueueWorker.run}},
I think it is safe to assume that we can safely move the waitQueue changes
inside it. With this change I was able to run the tests ~4000 times without
failures.
[~kgyrtkirk] or [~szita], could you please review?
Thanks,
Peter
> Flakyness in TestTaskExecutorService.testSetCapacity
> ----------------------------------------------------
>
> Key: HIVE-22584
> URL: https://issues.apache.org/jira/browse/HIVE-22584
> Project: Hive
> Issue Type: Test
> Reporter: Peter Vary
> Assignee: Peter Vary
> Priority: Major
> Attachments: HIVE-22584.2.patch, HIVE-22584.patch
>
>
> Very rarely the test fails:
> {code}
> java.lang.AssertionError: expected:<0> but was:<1>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:743)
> at org.junit.Assert.assertEquals(Assert.java:118)
> at org.junit.Assert.assertEquals(Assert.java:555)
> at org.junit.Assert.assertEquals(Assert.java:542)
> at
> org.apache.hadoop.hive.llap.daemon.impl.TestTaskExecutorService.testSetCapacity(TestTaskExecutorService.java:515)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
> {code}
> See:
> https://builds.apache.org/job/PreCommit-HIVE-Build/19739/testReport/org.apache.hadoop.hive.llap.daemon.impl/TestTaskExecutorService/testSetCapacity/
--
This message was sent by Atlassian Jira
(v8.3.4#803005)