Fix `test-invite-decider` which is flaky
In Circle the test invite decider test fails sometimes, e.g. --seed 498510815. There seems to be the fake login that is failing so no decider is able to join:
2022-06-20 07:41:04,895 [jetty-handlers-47 - - -] WARN org.eclipse.jetty.server.HttpChannel - /fake-login
java.lang.IllegalStateException: ABORTED
at org.eclipse.jetty.server.HttpChannelState.sendError(HttpChannelState.java:911)
at org.eclipse.jetty.server.Response.sendError(Response.java:492)
at ring.adapter.jetty9$proxy_handler$fn__52581.invoke(jetty9.clj:82)
at ring.adapter.jetty9.proxy$org.eclipse.jetty.servlet.ServletHandler$ff19274a.doHandle(Unknown Source)
Which leads to this:
[:fail] expected: (= {:application/decision :approved, :event/actor "new-decider", :event/type :application.event/decided} (-> (btu/context-getx :application-id) applications/get-application-internal :application/events last (select-keys [:application/decision :event/actor :event/type]))). actual: (not (= {:application/decision :approved, :event/actor "new-decider", :event/type :application.event/decided} #:event{:actor "new-decider", :type :application.event/decider-joined}))
FAIL in rems.test-browser/test-invite-decider (test_browser.clj:856)
check decision event
Expected:
{:application/decision :approved,
:event/actor "new-decider",
:event/type :application.event/decided}
Actual:
{:event/actor "new-decider",
:event/type -:application.event/decided +:application.event/decider-joined,
-:application/decision :approved}
The fail message actually says that the last event recorded was :application.event/decider-joined. I wonder if there is some race condition, because the error comes after decider has (successfully) submitted their decision.
The fail message actually says that the last event recorded was
:application.event/decider-joined. I wonder if there is some race condition, because the error comes after decider has (successfully) submitted their decision.
Maybe it has changed now. I got this a few times yesterday on my local machine. Whenever watching what happens, it always worked.
Error regarding java.lang.IllegalStateException: ABORTED has been fixed in https://github.com/CSCfi/rems/commit/06322249bd60a1a84c9d79d8931385eee20a2937
I observed another error in the same test, which probably happens when chromedriver manages to input only partial text