(REF) Move testGitLabIssue1108() to its own class
authorTim Otten <totten@civicrm.org>
Thu, 11 Jan 2024 04:23:55 +0000 (20:23 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 24 Jan 2024 08:47:36 +0000 (00:47 -0800)
commitbcf628a50d269b163667e1a8dff49fd4db0b4635
treeeccb624de93f2cbaa8a7fd34835e40c7106cf3ef
parent9318114e197b61f2092ccc9ec8a8b9936744baad
(REF) Move testGitLabIssue1108() to its own class

BEFORE: `MailingSystemTest` (which extends `BaseMailingSystemTest`)
includes `testGitLabIssue1108($isMultilingual)`. This is
a transactional test (per `BaseMailingSystemTest::setUp()`).

AFTER: `MultingualSystemTest` includes `testGitLabIssue1108()`.
This is not a transactional test.

COMMENTS: This resolves some circumstantial flakiness in the tests.

* The problem appeared when adding an unrelated test `BaseMailingSystemTest` -- the
  new test failed because of a conflict with `testGitLabIssue1108()`.
* You could also produce the problem in other cases by switching around the order of
  `testGitLabIssue1108()` (e.g. hack data-provider `multiLingual()`)
* I believe the root problem is that `BaseMailingSystemTest` is written as
  a transactional test -- but `testGitLabIssue1108()` does large-scale
  schema changes (whenever it toggles multilingual), which makes it
  non-transactional.
* The patch here prevents these kind of conflicts by putting
  `testGitLabIssue1108()` in a separate (non-transactional) context.
tests/phpunit/CRM/Mailing/MailingSystemTest.php
tests/phpunit/CRM/Mailing/MultilingualSystemTest.php [new file with mode: 0644]