Problem/Motivation

The tests are currently failing for D8.1. This is caused by an exception thrown in honeypot_get_time_limit(): it tries to query the flood table to see how often an anonymous user has been caught in the honeypot trap. However, the flood table is not created until the first event is registered, causing the query to fail.

Proposed resolution

Unfortunately, the default Flood implementation does not have a getCount() function, and ensureTableExists() is private, so the proposed solution is to catch the exception, and if the flood table does not exist, assume number of captures == 0.

Alternatively, we could check if the table exists prior to querying, but this would add a database roundtrip to each request for anonymous users.

Longer term we should get rid of the query on the flood table, since it is a swappable service and info might be stored elsewhere. This issue is just to get the tests back to green though, so I'll open a separate issue for that.

Remaining tasks

Review the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.baileys created an issue. See original summary.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
1.83 KB

Fixed a documentation issue.

mr.baileys’s picture

Added #2674008: Remove usage of Flood service from Honeypot, if that lands, the tests should automatically be green and this patch is no longer needed.

geerlingguy’s picture

Status: Needs review » Closed (won't fix)

Status: Closed (won't fix) » Needs work

The last submitted patch, 2: honeypot-flood-exception-2.patch, failed testing.

geerlingguy’s picture

Status: Needs work » Closed (won't fix)

Bad testbot :P