Skip to content
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

[NFC/Unit test] - Fix secondary issue with case token consistency test #21369

Merged
merged 1 commit into from
Sep 4, 2021

Conversation

demeritcowboy
Copy link
Contributor

Overview

Intermittently failing test

Before

e.g.

CRM_Utils_TokenConsistencyTest::testCaseTokenConsistency
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 Ongoing\n
 No\n
 2021-09-04 06:22:17\n
-2021-09-04 06:22:17\n
+2021-09-04 06:22:18\n
 '

After

Technical Details

api3 case create calls CRM_Case_BAO_Case::create to create the Case record, and stores it in $caseBAO. It then calls the xmlprocessor to populate the timeline, which via activity triggers updates case.modified_date. Then it returns the $caseBAO from before that as the api result. If there's a split-second delay then $caseBAO['modified_date'] won't match the latest modified_date, which is what the evaluated token uses.

Comments

Is test

@civibot
Copy link

civibot bot commented Sep 4, 2021

(Standard links)

@civibot civibot bot added the master label Sep 4, 2021
@colemanw
Copy link
Member

colemanw commented Sep 4, 2021

Good detective work!

@eileenmcnaughton eileenmcnaughton merged commit df49024 into civicrm:master Sep 4, 2021
@demeritcowboy demeritcowboy deleted the case-token-take-2 branch September 4, 2021 21:58
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.

3 participants