Skip to content

Commit 0ea18ff

Browse files
committed
Try fix test
1 parent eef0eaa commit 0ea18ff

File tree

1 file changed

+21
-12
lines changed
  • demo/integration-tests/webapp-vaadin-it/src/test/java/software/xdev/sse/demo/vaadin/cases

1 file changed

+21
-12
lines changed

demo/integration-tests/webapp-vaadin-it/src/test/java/software/xdev/sse/demo/vaadin/cases/LoginOIDCTest.java

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,27 @@ void checkReLoginShouldKeepUrl(final TestBrowser browser)
5757
{
5858
this.startAll(browser, dbCtrl -> dbCtrl.useNewEntityManager(em -> new DefaultDG(em).generateAll()));
5959

60-
this.loginAndGotoMainSite();
61-
this.navigateTo("another");
62-
63-
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another"));
64-
65-
// Delete all cookies of the CURRENT domain
66-
this.ensureAllCookiesDeleted();
67-
this.getWebDriver().navigate().refresh();
68-
69-
// Should be restored to the same path/view
70-
Assertions.assertDoesNotThrow(() ->
71-
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another?continue")));
60+
// Race condition in chrome on low CPU machines where you land on /login?error
61+
// Problem not reproducable locally or with Firefox
62+
Unreliables.retryUntilSuccess(
63+
browser == TestBrowser.CHROME ? 2 : 1,
64+
() -> {
65+
this.loginAndGotoMainSite();
66+
this.navigateTo("another");
67+
68+
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another"));
69+
70+
// Delete all cookies of the CURRENT domain
71+
this.ensureAllCookiesDeleted();
72+
73+
this.getWebDriver().navigate().refresh();
74+
75+
// Should be restored to the same path/view
76+
Assertions.assertDoesNotThrow(() ->
77+
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another?continue")));
78+
79+
return null;
80+
});
7281
}
7382

7483
@DisplayName("Re-Login should not keep url if view does not exist")

0 commit comments

Comments
 (0)