Problem/Motivation

EntityTypedDataDefinitionTest fails on MySQL with an AJAX error. The relevant part of the error message is:
Data too long for column 'message' at row 1: INSERT INTO {simpletest} (...
There are two problems here. One is that the test case is using assertEquals() with no message and passing in two serialized entities as arguments. The other is that simpletest is not validating its input and failing cleanly.

Proposed resolution

Since the base test class being used is deprecated, my proposed resolution is:

  • Use the new kernel test which compares objects and just stores the difference in the message, in case it fails, but don't store anything, if it works fine

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blackra created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
Issue tags: +rc eligible
FileSize
1.23 KB

Interesting, this is the easiest bugfix I can think of. ... PHPUnit just doens't store the entire objects when they are equal.

Berdir’s picture

Is this the only broken test? I think I've seen others explode like this on things like assertNull($term) when they are failing. Those are web tests, so we can't just convert them to phpunit :)

Should we try to make our logging/verbose comparison output better?

blackra’s picture

Berdir, yes we should, but not for this issue. If you know of any other broken simpletest tests (especially web test cases), please open issues for them.

For this particular issue, the original base class is \Drupal\simpletest\KernelTestBase which has been deprecated in favour of one that works. The replacement doesn't give you the most friendly of output, but at least you know which test is failing and it doesn't kill the whole testsuite.

I have tested this, running it from the command line. I also tried adding a '.' to one of the serialized objects to cause this test to fail. It fails cleanly (although it gives a lengthy binary diff in the output).

An additional piece of information from Mixologi- is that the d.o bots use sqlite for running tests, and it has different constraints from running things through the UI with a MySQL database.

Anyway, I think this has had enough testing and reviewing for such a simple change. Marking this as RTBC.

blackra’s picture

Status: Needs review » Reviewed & tested by the community

Actually marking it as RTBC this time :-)

catch’s picture

Status: Reviewed & tested by the community » Needs review

There's no change to the assertEqual here - so either the patch or the issue summary needs updating?

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

There's no change to the assertEqual here - so either the patch or the issue summary needs updating?

Let me explain what is going on

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 2609770-2.patch, failed testing.

catch’s picture

Status: Needs work » Needs review

Future archeologists thank you.

But I just committed and reverted this again, because now we report fatal errors, the patch is failing.

  • catch committed 22d31a7 on 8.1.x
    Revert "Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails...
  • catch committed 45ac65c on 8.1.x
    Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails on MySQL
    
Mile23’s picture

Status: Needs review » Needs work

::future archaeologist raises hand::

Thanks.

I'm seeing this as a consequence of #2624926: Refactor run-tests.sh for Console component.

Running the patched test as php ./core/scripts/run-tests.sh --class "Drupal\\KernelTests\\Core\\Entity\\EntityTypedDataDefinitionTest" yields a happy passing test. This is without sqlite.

Running it in the UI leads to unhappiness in the form of "No test results to display."

Also, I can repro the original issue in the UI unpatched. I get this:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=48&op=do_nojs&op=do
StatusText: Internal Server Error
ResponseText: {"message":"A fatal error occurred: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column \u0027message\u0027 at row 1: INSERT INTO {simpletest}

[...]
pflame’s picture

Status: Needs work » Needs review
FileSize
1.12 KB

Added message parameter to assertEqual which removed this error and test case passed.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • catch committed 22d31a7 on 8.3.x
    Revert "Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails...
  • catch committed 45ac65c on 8.3.x
    Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails on MySQL
    

  • catch committed 22d31a7 on 8.3.x
    Revert "Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails...
  • catch committed 45ac65c on 8.3.x
    Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails on MySQL
    

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • catch committed 22d31a7 on 8.4.x
    Revert "Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails...
  • catch committed 45ac65c on 8.4.x
    Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails on MySQL
    

  • catch committed 22d31a7 on 8.4.x
    Revert "Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails...
  • catch committed 45ac65c on 8.4.x
    Issue #2609770 by dawehner: EntityTypedDataDefinitionTest fails on MySQL
    

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

amateescu’s picture

Status: Needs review » Closed (outdated)

EntityTypedDataDefinitionTest runs just fine on MySQL these days :)