-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-3616] Add basic Selenium tests to WebUISuite #2474
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
Conversation
|
QA tests have started for PR 2474 at commit
|
|
QA tests have finished for PR 2474 at commit
|
|
@JoshRosen how much time does this add to the test harness? |
|
@pwendell According to Jenkins, UISuite took ~11 seconds to run, compared to ~2.9 seconds before this PR (although three of the tests were previously disabled). |
|
Hmm - O(seconds) is a lot for new tests considering the quantity of tests we have. Is there a constant overhead in launching selenium that gets amortized over future tests we add here? If that's the case it seems fine. |
|
If the only issue here is test speed, maybe we can disable the slower tests by default on Jenkins. |
|
Note to self / reviewers: #2489 addresses another httpclient dependency issue and will probably conflict with this. |
|
Agreed that this can indeed cause conflicts. @JoshRosen, do you know which version of httpclient does this change effectively resolves to? |
|
@aniketbhatnagar It looks like both of our patches replace One question, though: how backwards-compatible is the HttpComponents version of HttpClient? Do different versions provide different compatibility guarantees? I found a blog post suggesting that it's not fully compatible: http://blog.teamextension.com/migrating-from-httpclient-3-1-to-4-0-34. Are there newer versions of the dependencies that depend on HttpClient (e.g. jets3t) which use the newer version? |
|
It looks like we determine the jets3t version based on which Hadoop version we're using. Based on discussion in #629, it looks like we need to keep doing this rather than updating to 0.9.x across the board, since older Hadoop versions need the older version. Unfortunately, jets3t 0.7. depends on commons-httpclient:3.1. @srowen, do you have any thoughts here? |
|
Yes, as I recall, Hadoop 1 + S3 requires jets3t 0.7 to work correctly. (Or else we would have also updated it to 0.9). I also believe that 3.x and 4.x of the HTTP libraries are fairly incompatible. Are they actually different artifacts though? Can you let jets3t use 3.x of the old artifact and still freely adjust what version of the 4.x artifact you use? this part I forget, whether they made brand new artifact names for 4.x. |
Hmm, they are different artifacts. Maybe HttpClient itself isn't the problem here. Here's the actual exception that I get if I undo my Maven changes: |
|
When I wiped out my then it looks like |
|
It looks like this isn't an issue in the Maven build. Investigating to see if I can figure out how the older JAR is winding up on the SBT test classpath. When I run |
|
Making a little more progress: If I add import org.apache.http.impl.cookie.BrowserCompatSpecFactory
System.getProperty("java.class.path").split(":").foreach(println)
val f = new File(classOf[BrowserCompatSpecFactory].getProtectionDomain().getCodeSource().getLocation().getPath());
println(f.getAbsolutePath)to the top of UISuite, then it looks like only |
|
I'm going to give up and return to this later. Even if I look at the actual classloader that loads BrowserCompatSpecFactory using classOf[BrowserCompatSpecFactory].getClassLoader.asInstanceOf[URLClassLoader].getURLs().foreach(println)I still don't see the outdated |
|
Actually, @ScrapCodes, do you have any ideas of what I should try here? |
|
@JoshRosen It looks like HttpClient 4.1.3 comes in from Thrift via Hive: ... but that's weird if it has some effect on core tests, of course. This could be a red herring, but that's where 4.1.3 may be coming from, and then sticking around and getting put on some classpath. This method went in late November 2012: So would be in about version 4.2.3 or higher: ... which you probably already figured, that 4.1.3 (or some copy from earlier than about 4.2.3) must be the problem. (I think that the 3.x artifacts aren't an issue, because they're different artifacts.) In your patch, you don't make |
|
@JoshRosen adding to what mentioned, here is a gist of dependency tree before and after my patch would be applied - https://gist.github.com/aniketbhatnagar/b39e587d4f4a014870d1 As @srowen, httpclient seems to be coming from Thrift via Hive and what my patch attempts to do is force a newer (& compatible) version of the library in Kinesis-asl profile only. Hope it helps. |
Actually, the code in this PR works fine (note that the SparkQA tests passed). The issue that I was referring to crops up when I remove the |
|
Rather than bumping |
This patch adds Selenium tests for Spark's web UI. To avoid adding extra dependencies to the test environment, the tests use Selenium's HtmlUnitDriver, which is pure-Java, instead of, say, ChromeDriver. I added new tests to try to reproduce a few UI bugs reported on JIRA, namely SPARK-3021, SPARK-2105, and SPARK-2527. I wasn't able to reproduce these bugs; I suspect that the older ones might have been fixed by other patches. I also upgraded ScalaTest to 2.2.1.
fb2a0f9 to
510e54a
Compare
|
Thanks to the Hive 13 patch being merged, it's no longer necessary for me to add an explicit version of httpclient. I've pushed a new commit which moves these Selenium tests to their own suite which isn't run by default. For now, the only way to run this suite is to manually uncomment the Once this passes tests, I'm going to merge this so that I can use this basic test framework in some subsequent PRs to fix a few display bugs. |
|
Test build #22224 has started for PR 2474 at commit
|
|
Test build #22224 has finished for PR 2474 at commit
|
|
Test FAILed. |
|
Jenkins, retest this please. |
|
Test build #22226 has started for PR 2474 at commit
|
|
Test build #22226 has finished for PR 2474 at commit
|
|
Test FAILed. |
|
Jenkins, retest this please. |
|
Test build #22232 has started for PR 2474 at commit
|
|
Test build #22233 has started for PR 2474 at commit
|
|
Test build #22232 has finished for PR 2474 at commit
|
|
Test FAILed. |
|
Test build #22233 has finished for PR 2474 at commit
|
|
Test FAILed. |
|
I tried downloading and building this locally and it looks like there's a legitimate build failure in Catalyst: This looks like a legitimate build failure, but I'm not sure how this PR could have caused it. |
|
Oh, I see: "scalautils" was renamed to "scalactic" in ScalaTest 2.2.0+. I'd still like to bump ScalaTest so that we're using the newest version of the ScalaTest's Selenium integration and so that we benefit from the tagged tests improvements:
I'll push a fixup commit to port us over to the new ScalaTest. |
|
Test build #22236 has started for PR 2474 at commit
|
|
Test build #22236 has finished for PR 2474 at commit
|
|
Test PASSed. |
|
I've merged this into master. I'm going to close out a few of the old, unreproducible UI JIRAs for which I've added Selenium regression tests. |
This patch adds Selenium tests for Spark's web UI. To avoid adding extra
dependencies to the test environment, the tests use Selenium's HtmlUnitDriver,
which is pure-Java, instead of, say, ChromeDriver.
I added new tests to try to reproduce a few UI bugs reported on JIRA, namely
SPARK-3021, SPARK-2105, and SPARK-2527. I wasn't able to reproduce these bugs;
I suspect that the older ones might have been fixed by other patches.
In order to use HtmlUnitDriver, I added an explicit dependency on the
org.apache.httpcomponents version of httpclient in order to prevent jets3t's
older version from taking precedence on the classpath.
I also upgraded ScalaTest to 2.2.1.