-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Adds tests for quarkus.http.auth.form.new-cookie-interval #6013
Adds tests for quarkus.http.auth.form.new-cookie-interval #6013
Conversation
...ttp/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/PersistentLoginManager.java
Outdated
Show resolved
Hide resolved
...ttp/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/PersistentLoginManager.java
Outdated
Show resolved
Hide resolved
70954ed
to
3c69461
Compare
@stuartwdouglas Changes to logging pushed. Thank you for review. |
@stuartwdouglas @sberyozkin Hello, is there anything else I can do for this PR? |
@stuartwdouglas @sberyozkin Hello, is there anything I can do to get this PR unstuck? Thx for letting me know. 🎱 |
@Karm the new test failed on windows |
@stuartwdouglas Lemme try on my Windows box and investigate. I will try to throttle down its I/O capacity to make sure the test passes on a feeble vm too. |
3c69461
to
24225c1
Compare
I set up Jenkins CI on Windows 2012R2 and Centos7 to compare. https://ci.modcluster.io/view/Quarkus/job/karm-quarkus/ (arbitrary GitHub login lets you in) Windows fails with 5 tests in the vertx-http module with Graalvm11 and/or HotSpot11as its JDK. See /testReport With Java 8, it is just 1 test that fails and it is this PR's one because See FormAuthCookiesTestCase/testCredentialCookieRotation Not sure how to fix that now. Gonna look into it. If @rsvoboda or @sberyozkin saw anything similar.... |
@Karm Hi, can you please rebase and force a new build ? May be we will be able to merge soon |
@sberyozkin I will, although I haven't really looked into how come that the RandomPort test apparently breaks this test of mine if you run them all...on Windows :-/ Lemme check again. |
Hey @Karm, I'm looking at the test code, and I wonder if it may be simplified somehow, I think it is very properly tested by the look of it, but I just suspect the test environment is not agile enough to cope with the ports recycling/etc |
24225c1
to
7662597
Compare
@sberyozkin, I went back to this one, logged output of what is going on in TestHTTPConfigSourceProvider and VertxHttpRecorder. The conclusion is that on Windows, all subsequent Quarkus deployments for all subsequent tests start with the port randomly generated for RandomPortTest deployment, e.g. 54320. The fix 0eabb66 is to clear env prop that is set in
in VertxHttpRecorder. I have no idea why it does not show on Linux 😃 I executed it 10 times on my Windows box and the fix seems stable. See the log: Before 0eabb66Note 60748 is erroneously used in following tests.
After 0eabb66Note 59846 correctly followed by 8081.
|
Azure pipeline failed with an inverted case:
Quarkus starts on a correct port, 8081, while TestHTTPConfigSourceProvider reports 45537. I cannot reproduce this on my Windows VM with Java 11 though. I can see Azure running with Java 8, so lemme try that... 😢 |
I attempted to address this here: https://github.com/quarkusio/quarkus/pull/7109/files#diff-ff552dc9ca707b4297c93a03adf556d6R644 although something else seems to have gone wrong with the pr, I will investigate tomorrow. |
6b80dcb
to
7446beb
Compare
I have removed
from RandomPortTest.java as it is not needed since 7446beb is in now. |
@stuartwdouglas With the latest commit it flawlessly passed two times already the point where it failed previously, i.e. no hiccup caused by RandomPortTest. The reported failures in the current broader run are kinda weird build fails with Maven...totally unrelated:
Is there a way I could re-run just this part of the pipeline and not all the checks again? |
It failed this time on a genuine test result; test added in this PR:
Despite the fact that the time spans in the test are lenient and worked well even on my slow Windows VM, it might not be enough for this CI. I really hope that there are not multiple instances of Quarkus running and that the test is not talking to a different instance randomly 😃 I will make the time spans even more forgiving and watch the re-run. |
7446beb
to
50bc77b
Compare
|
@sberyozkin Could you restart just those two canceled ones, please? It seems I cannot do that. |
Solved. |
Solved. |
…terval There are three generally accepted behaviors for timeout and renewal for credential session cookies. 1. [absolute-timeout](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#absolute-timeout) 1. [idle-timeout]( https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#idle-timeout) 1. [renewal-timeout](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#renewal-timeout) Quarkus implements 2. as **timeout** (```quarkus.http.auth.form.timeout```) and 3. as **newCookieInterval** (```quarkus.http.auth.form.new-cookie-interval```). The implementation of 3. does not renew the cookie as expected. The test does login, several requests and uses ```Thread.sleep(...);``` to pace them. I hope this is not deemed problematic for the stability of TS on very slow/weirdly behaving systems. The margins are generous though, in hundreds of ms. The test passes with the fixed calculation of cookie renewal and it fails with the current one: ``` org.opentest4j.AssertionFailedError: Session cookie WAS eligible for renewal and should have been updated. at io.quarkus.vertx.http.security.FormAuthCookiesTestCase. testCredentialCookieRotation(FormAuthCookiesTestCase.java:183) ``` Thank you for feedback. Concatenates log messages, drops level from warn to debug
50bc77b
to
08e0b81
Compare
@Karm Thanks |
@gsmet Could we have this merged then for 1.3? |
There are three generally accepted behaviors for timeout and renewal for credential session cookies.
Quarkus implements 2. as timeout (
quarkus.http.auth.form.timeout
) and 3. as newCookieInterval (quarkus.http.auth.form.new-cookie-interval
).The implementation of 3. does not renew the cookie as expected.
The test does login, several requests and uses
Thread.sleep(...);
to pace them. I hope this is not deemed problematic for the stability of TS on very slow/weirdly behaving systems.The margins are generous though, in hundreds of ms.
The test passes with the fixed calculation of cookie renewal and it fails with the current one:
Thank you for feedback.
Fixes #6011
@sberyozkin @stuartwdouglas