Done
Details
Details
RCA Group
TBD
Assignee
Shans Kaluhin
Shans KaluhinReporter
Viacheslav Kolesnyk
Viacheslav KolesnykLabels
Priority
Story Points
2
Sprint
None
Development Team
Spitfire
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created February 23, 2023 at 3:38 PM
Updated March 25, 2023 at 10:52 AM
Resolved March 15, 2023 at 9:02 AM
Overview:
Assertions are the same for three of linked bib update tests in `MarcBibUpdateModifyEventHandlerTest` They are located in the end of `verifyBibRecordUpdate` method:
verify(getRequestCount, getRequestedFor(URL_PATH_PATTERN)); verify(putRequestCount, putRequestedFor(URL_PATH_PATTERN));
For now they are located outside of asynchronous 'handle' method execution so they run before the process finishes and so - fail (you can see that in test logs).
But tests don't fail because verification exception is not handled and 'context.fail(...)' is not called.
If we rewrite this assertions like this:
try { verify(getRequestCount, getRequestedFor(URL_PATH_PATTERN)); verify(putRequestCount, putRequestedFor(URL_PATH_PATTERN)); } catch (VerificationException ex) { context.fail(ex); }
and put them inside 'whenComplete' of 'handle' completable future (right before 'async.complete();' call) - they work as expected (no errors in logs / test fails if wrong parameter passed to assertion) locally, but tests fail on build server this way with 'TimeoutException' and no stack trace (timeout after running test for 2 minutes).
Example run with test failures:
https://jenkins-aws.indexdata.com/job/folio-org/job/mod-source-record-storage/job/MODDICORE-309/1/
Possibly it could be helpful to check tests in other module to see how Wiremock verifications are made in conjunction with VertX async execution.
Purpose:
Rework this assertions so they are not ignored (these are main assertions for those tests) and tests pass on build server.