Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mposolda
Copy link
Contributor

Closes #21778 #21779 #21780

There are 2 problems with the script tests.

  1. When the Quarkus server is restarted on Windows, it is a chance that some H2 DB transactions, which were commited shortly before the restart, are lost. So for instance when some test (like DeployedScriptAuthenticatorTest, but can be any other test) imports test realm, and then restarts server, it is a chance that after restart, the test realm is not available. Something about this is described in the H2 documentation http://repository.transtep.com/repository/thirdparty/H2/1.0.63/docs/html/advanced.html#durability_problems . I've added delay 2 seconds on windows before restart the server, which should ensure all the commited transactions should be synced to the disk

  2. All the script tests are doing deploy/undeploy of script archives after every method, which makes them very uneffective and bad for performance as each deploy/undeploy causes server restart. I've changed this to deploy/undeploy once per class (before class and after class).

@mposolda mposolda requested review from a team as code owners July 25, 2023 09:02
@mposolda mposolda requested a review from a team July 25, 2023 09:02
@mposolda mposolda requested a review from a team as a code owner July 25, 2023 09:02
Copy link
Contributor

@stianst stianst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm running the DeployedScriptAuthenticatorTest 30 times on Windows here to check if it works now:
https://github.com/stianst/keycloak/actions/runs/5654860411

@cypress
Copy link

cypress bot commented Jul 25, 2023

1 flaky tests on run #8228 ↗︎

0 527 48 0 Flakiness 1

Details:

Merge 1e6a9a7 into 4bc6d2b...
Project: Keycloak Admin UI Commit: d87ad0e417 ℹ️
Status: Passed Duration: 16:33 💡
Started: Jul 25, 2023 9:13 AM Ended: Jul 25, 2023 9:29 AM
Flakiness  cypress/e2e/authentication_test.spec.ts • 1 flaky test • chrome

View Output Video

Test Artifacts
Authentication test > should add a condition Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Contributor

@stianst stianst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: org.keycloak.testsuite.script.DeployedScriptAuthenticatorTest#testScriptAuthenticatorNotAvailable

2 participants