提交 08aaf2b9 编写于 作者: J Jesse Glick

Trying to make AsynchPeopleTest more robust.

https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/1369/testReport/junit/hudson.model/AsynchPeopleTest/display/
org.junit.ComparisonFailure: expected:<[display: none;]> but was:<[]>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at hudson.model.AsynchPeopleTest.display(AsynchPeopleTest.java:44)
was presumably a race condition.
Could reproduce by adding a Thread.sleep into AsynchPeople.compute.
This patch (with waitForBackgroundJavaScript) avoids that error;
but causes the assertNotNull at the end to fail, for reasons TBD.
上级 ae6ec849
......@@ -40,7 +40,9 @@ public class AsynchPeopleTest {
@Bug(18641)
@Test public void display() throws Exception {
User.get("bob");
HtmlPage page = j.createWebClient().goTo("asynchPeople");
JenkinsRule.WebClient wc = j.createWebClient();
HtmlPage page = wc.goTo("asynchPeople");
assertEquals(0, wc.waitForBackgroundJavaScript(120000));
assertEquals("display: none;", page.getElementById("status").getAttribute("style"));
assertNotNull(page.getElementById("person-bob"));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册