Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#49367 closed defect (bug) (fixed)

MariaDB Galera Cluster fails tests due to MyISAM being forced

Reported by: xkon's profile xkon Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: dev-feedback has-patch
Focuses: Cc:

Description

I'm opening this ticket after the weekly hosting-community meeting on Slack.

The original report can be found on the phpunit-test-runner Github issues at https://github.com/WordPress/phpunit-test-runner/issues/89 .

It seems that we're forcing the test setup here to use MyISAM , https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/tests/dbdelta.php#L49 which isn't supported in some environments.

Specifically in this case the MariaDB Galera Cluster only supports InnoDB/XtraDB so the tests are failing.

As WordPress doesn't require MyISAM in general & if possible we should be adding a check here to see what engine is supported and change from MyISAM to InnoDB respectively to avoid issues like this.

Attachments (1)

49367.diff (11.2 KB) - added by xkon 5 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#2 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 47193:

Tests: In Tests_dbDelta::setUp(), only force MyISAM database engine on MySQL versions older than 5.7.

Since MySQL 5.7, InnoDB engine supports FULLTEXT indexes, so forcing MyISAM is unnecessary.

Props xkon, joonasvanhatapio, SergeyBiryukov.
Fixes #49367.

This ticket was mentioned in Slack in #hosting-community by amykamala. View the logs.


5 years ago

#4 follow-up: @xkon
5 years ago

@SergeyBiryukov after checking out the tests, in general, I see plenty of explicitly stated MyISAM i.e.

https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/tests/dbdelta.php#L453
https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/tests/dbdelta.php#L478

And the list goes on ( all instances are within the dbdelta.php though so it makes it kinda easier ), should those be updated also in a similar manner? I'm guessing that if MyISAM isn't supported the dbDelta() itself would fail there also, correct? Sorry, I missed this before I didn't think of making a full search 😅.

Not sure at all on this btw (trying to figure out a way to test this on my end) so I'm just asking :)

Last edited 5 years ago by xkon (previous) (diff)

#5 in reply to: ↑ 4 @SergeyBiryukov
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to xkon:

after checking out the tests, in general, I see plenty of explicitly stated MyISAM

Indeed, thanks for catching that! Yes, those should be updated in a similar manner.

@xkon
5 years ago

#6 @xkon
5 years ago

  • Keywords has-patch added; needs-patch removed

49367.diff creates a new static function to force the engine if needed and changes all MyISAM statements to dynamically be populated by the function.

I believe this should do the trick on all of them.

#7 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 47195:

Tests: In Tests_dbDelta, only force MyISAM database engine on MySQL versions older than 5.7.

Since MySQL 5.7, InnoDB engine supports FULLTEXT indexes, so forcing MyISAM is unnecessary.

Follow-up to [47193], which addressed the issue in Tests_dbDelta::setUp(), but missed other tests.

Props xkon, joonasvanhatapio, SergeyBiryukov.
Fixes #49367.

Note: See TracTickets for help on using tickets.