Skip to content

Fix postfixOps warnings in the test suite #1323

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

Closed
wants to merge 1 commit into from

Conversation

willb
Copy link
Contributor

@willb willb commented Jul 7, 2014

This PR fixes compiler warnings in the test suite related to scala.language.postfixOps not being in scope within the test classes in which postfix operations were actually used.

@srowen
Copy link
Member

srowen commented Jul 7, 2014

This covers a lot of the same ground as #1153 . It would be great to get all of this in to stop the warnings.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@willb
Copy link
Contributor Author

willb commented Jul 7, 2014

@srowen sorry, I hadn't noticed the other PR! I think the postfixOps change in mine is disjoint, though.

@AmplabJenkins
Copy link

Merged build finished. All automated tests passed.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16385/

@rxin
Copy link
Contributor

rxin commented Jul 8, 2014

I just merged #1153 and unfortunately this one is no longer mergeable. Will - mind updating it?

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@willb
Copy link
Contributor Author

willb commented Jul 8, 2014

@rxin Done; I also updated the comment to reflect the narrower focus after eliminating overlap with #1153. Thanks!

@willb willb changed the title Fix (some of the) warnings in the test suite Fix postfixOps warnings in the test suite Jul 8, 2014
@AmplabJenkins
Copy link

Merged build finished. All automated tests passed.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16407/

Previously, language.postfixOps was imported at toplevel, which meant
compiler warnings since it wasn't visible inside the classes that used
postfix operations.  This commit moves the import to suppress these
warnings.
@SparkQA
Copy link

SparkQA commented Aug 4, 2014

QA tests have started for PR 1323. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17854/consoleFull

@witgo
Copy link
Contributor

witgo commented Aug 4, 2014

Related work #1330

@SparkQA
Copy link

SparkQA commented Aug 4, 2014

QA results for PR 1323:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17854/consoleFull

@willb
Copy link
Contributor Author

willb commented Aug 6, 2014

Can someone take a look at this again?

@andrewor14
Copy link
Contributor

@willb @witgo What is the difference between your patches? Are they the same?

@jkbradley
Copy link
Member

@willb Hi, I was asked to take a look at this. I tried the current master + this PR merged with master, and I did not see much difference in warnings (or any warnings about postfixOps). Could you please show the warnings, and info which might indicate the system/setup which produces the warnings? Thank you!

@willb
Copy link
Contributor Author

willb commented Sep 12, 2014

Hi @jkbradley; thanks for taking a look. Here are the warnings as I see them when compiling tests on the immediate ancestor of my branch, which is 56e009d (I'm running on OS X 10.9 in this case):

[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:38: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn] This can be achieved by adding the import clause 'import scala.language.postfixOps'
[warn] or by setting the compiler option -language:postfixOps.
[warn] See the Scala docs for value scala.language.postfixOps for a discussion
[warn] why the feature should be explicitly enabled.
[warn]   implicit val defaultTimeout = timeout(10000 millis)
[warn]                                               ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:99: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       preGCTester.assertCleanup()(timeout(1000 millis))
[warn]                                                ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:117: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       preGCTester.assertCleanup()(timeout(1000 millis))
[warn]                                                ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:134: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       preGCTester.assertCleanup()(timeout(1000 millis))
[warn]                                                ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:156: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       preGCTester.assertCleanup()(timeout(1000 millis))
[warn]                                                ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:187: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       preGCTester.assertCleanup()(timeout(1000 millis))
[warn]                                                ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala:290: postfix operator millis should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(waitTimeout, interval(100 millis)) {
[warn]                                            ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala:138: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]     failAfter(10 seconds) {
[warn]                  ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala:174: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]     failAfter(10 seconds) {
[warn]                  ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:42: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                             ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:42: postfix operator milliseconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                                                   ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:56: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                             ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:56: postfix operator milliseconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                                                   ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:75: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                             ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:75: postfix operator milliseconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                                                   ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:89: postfix operator seconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {
[warn]                             ^
[warn] /Users/willb/Documents/src/scala/alternate-spark/core/src/test/scala/org/apache/spark/ui/UISuite.scala:89: postfix operator milliseconds should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn]       eventually(timeout(10 seconds), interval(50 milliseconds)) {

Moving the import to within the test class (as in my patch) eliminated the warnings.

@andrewor14
Copy link
Contributor

Hi @wllib can you comment on #1330? What is the difference between that patch and this, and which is the better approach? It seems to me that simply removing the postFixOps import is sufficient in eliminating the warnings.

@willb
Copy link
Contributor Author

willb commented Sep 12, 2014

Hey @andrewor14, thanks for the reply. First off, I absolutely agree with @srowen's comment on #1330 that imports (not compiler flags) are the right way to handle enabling these language features. It looks to me like SpanSugar pulls in postfixOps -- and that it's the only thing in those files that uses postfixOps. (I guess having both SpanSugar and postfixOps imported at toplevel was causing some implicit resolution confusion?)

In any case, the approach in #1330 is probably the way to go since explicitly importing postfixOps seems unnecessary and removing the compiler flag is a good idea. Thanks again for taking a look!

@willb willb closed this Sep 12, 2014
@andrewor14
Copy link
Contributor

I see, thanks for your patch anyway!

kazuyukitanimura pushed a commit to kazuyukitanimura/spark that referenced this pull request Aug 10, 2022
…ault (apache#1323)

### What changes were proposed in this pull request?

This PR aims to add a new executor roll policy, `OUTLIER`, which aims to detect various outliers first, and use it by default.
If there is no outlier, it will work like `TOTAL_DURATION` policy.

### Why are the changes needed?

The users can use `OUTLIER` policy to consider the outliers in terms of multiple dimensions.
In addition, this will be a better default policy.

### Does this PR introduce _any_ user-facing change?

No. This is a new feature in Apache Spark 3.3.

### How was this patch tested?

Pass the CIs with the newly added test cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants