-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make completion proposal calculation test time-independent #906 #967
base: master
Are you sure you want to change the base?
Make completion proposal calculation test time-independent #906 #967
Conversation
Test Results 852 files ±0 852 suites ±0 1h 5m 26s ⏱️ - 5m 36s For more details on these failures, see this check. Results for commit 0b34f69. ± Comparison against base commit 05c67f7. ♻️ This comment has been updated with latest results. |
d0900c8
to
f7c555a
Compare
assertFalse("Concurrent requests for finishing computation of long running content assist processor", shouldComputationFinish); | ||
shouldComputationFinish = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could allow 2 threads to call finishComputation
and NOT fail if they both reach line 47 "at the same time".
You could either add synchronized
to this method (which would NOT get rid of a race condition in the while
-loop in line 35) or use an AtomicBoolean
and call assertFalse(..., shouldComputationFinish.getAndSet(false))
instead.
} | ||
shouldComputationFinish = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? The field is private i.e. no one will read it afterwards
286908a
to
99f9419
Compare
…atform#906 The test cases for completion proposals in CompletionTest depend on specific timing behavior of a test proposal processor. On one hand, this is prone to errors if proper timing is not given on the test environment. On the other hand, the tests run unnecessarily long because of waiting long enough. This change replaces the fixed-time waiting of the LongRunningBarContentAssistProcessor with an explicit trigger that finalizes the content calculation as soon as some barrier is reached within the tests. In addition, the long-running processor is only enabled on demand and will be finalized whenever a test case was executed to avoid that the processor thread is leaking to the next test case. Contributes to eclipse-platform#906
99f9419
to
0b34f69
Compare
The test cases for completion proposals in
CompletionTest
depend on specific timing behavior of a test proposal processor. On one hand, this is prone to errors if proper timing is not given on the test environment. On the other hand, the tests run unnecessarily long because of waiting long enough.This change replaces the fixed-time waiting of the
LongRunningBarContentAssistProcessor
with an explicit trigger that finalizes the content calculation as soon as some barrier is reached within the tests. In addition, the long-running processor is only enabled on demand and will be finalized whenever a test case was executed to avoid that the processor thread is leaking to the next test case.Contributes to #906