Tests are broken on HEAD, only 2 tests seems passing.

Is there someone working on this ? I can provide help.

Comments

sylvain lecoy’s picture

Priority: Normal » Critical

Having the HEAD broken is kind of critical, I am working on a patch.

/ping maintainers :-)

jeremy’s picture

Priority: Critical » Major
Issue summary: View changes

There are some failing tests in 7.x-1.1-beta3, bumping this to review before a final 7.x-1.1 is released.

markpavlitski’s picture

Removed: posted in wrong thread.

markpavlitski’s picture

There can be issues with some of the passing tests too, not all of them always use the memcache backend.

See #1995556: Tests do not check if memcache backends are being used for background.

jeremy’s picture

Thanks, 1995556 has been committed.

Current failures are in MemCacheClearCase->testClearWildcardOnSeparatePages().

jeremy’s picture

Title: [HEAD] Tests broken » some memcache tests failing

Fixed the memcache statistics tests which were failing due to changes made to dmemcache.inc:
http://drupalcode.org/project/memcache.git/commitdiff/44998ba

markpavlitski’s picture

Status: Active » Needs review
StatusFileSize
new458 bytes

I'm seeing an exception in mecache-session.test:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cid' in 'where clause': DELETE FROM {users} WHERE (cid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 2 ) in cache_clear_all()

It was introduced when #1984226: Session handler uses D6 hook_user() instead of D7 hook_user_update() got committed, as the hook was never being run prior to the fix.

The second argument to cache_clear_all() should be 'cache_users' not 'users', however since it's not a core cache table I'd suggest we use dmemcache_delete() the same we do elsewhere for both 'users' and 'sessions' bins.

Patch attached.

markpavlitski’s picture

After applying the patch in #7, I'm getting all passes for both PECL Memcache 3.0.8 and PECL Memcached 2.1.0:

377 passes, 0 fails, 0 exceptions, and 81 debug messages

jeremy’s picture

Committed:
http://drupalcode.org/project/memcache.git/commitdiff/9f838d5

However, even with this sadly I'm not seeing the same results. I built a new test box to confirm it wasn't an environment issue. I can duplicate this on a MAMP stack as well as a LAMP stack.

I see:
368 passes, 12 fails, 0 exceptions, and 81 debug messages

The error overview is as follows:

  • Cache clear test: 70 passes, 10 fails, 0 exceptions, and 9 debug messages
  • Session tests: 149 passes, 2 fails, 0 exceptions, and 41 debug messages

In the cache clear test, I see failures in MemCacheClearCase->testClearWildcardOnSeparatePages() (lines 654 is a 404 resulting in cascading failures -- the test module is successfully enabled but apparently the paths are still not enabled). In the session test, I see failures in MemcacheSessionTestCase->testDataPersistence() (line 87) and MemcacheSessionTestCase->testEmptyAnonymousSession() (line 176).

markpavlitski’s picture

Status: Needs review » Needs work
jeremy’s picture

Priority: Major » Normal

While debugging this, I did a little cleanup to the test, committed here:
http://cgit.drupalcode.org/memcache/commit/?id=16d354d

However, there are still failures in the test -- the failure only happens in simpletest, if I test the same logic in a custom script it works perfectly. Thus, I believe what this needs is someone good with SimpleTest to debug the test itself. Further, I'm no longer considering this test failure a release blocker.

damienmckenna’s picture

FYI I was seeing a problem with the 'language' table being missing, because the 'locale' module wasn't enabled:

Test language_list() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table                       [error]
'drupal7.simpletest740028languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight
ASC, name ASC; Array
(
)
damienmckenna’s picture

Title: some memcache tests failing » Fix all tests
Status: Needs work » Needs review
StatusFileSize
new2.24 KB

With this patch I've gotten it down to the following:

$ drush cc all;drush test-run Memcache

Starting test MemCacheClearCase.
Cache clear test 74 passes, 4 fails, 0 exceptions, and 9 debug messages
Test MemCacheClearCase->testClearCacheLifetime() failed: Cache item was created successfully. in memcache.test on line 529
Test MemCacheClearCase->testClearTemporaryPermanent() failed: Three cache items were created for checking cache expiry. in memcache.test on line 593
Test MemCacheClearCase->testClearTemporaryPermanent() failed: Future cache item was not removed after clearing cid NULL. in memcache.test on line 603
Test MemCacheClearCase->testClearWildcardOnSeparatePages() failed: Cache was properly flushed. in memcache.test on line 697

Starting test MemCacheGetMultipleUnitTest.
Fetching multiple cache items 12 passes, 0 fails, and 0 exceptions
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.

 Group  Class


Starting test MemcacheLockFunctionalTest.
Locking framework tests 18 passes, 1 fail, 0 exceptions, and 4 debug messages
Test MemcacheLockFunctionalTest->testLockAcquire() failed: Lock not acquired by the other request. in
memcache-lock.test on line 58

Starting test MemCacheRealWorldCase.
Real world cache tests 54 passes, 0 fails, 0 exceptions, and 17 debug messages
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.

 Group  Class


Starting test MemCacheSavingCase.
Memcache saving test 20 passes, 2 fails, and 18 exceptions
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: unserialize(): Error at offset 0 of 2504825 bytes in dmemcache.inc on line 329
Test MemCacheSavingCase->checkVariable() failed: Array is saved and restored properly. in memcache.test on line 361
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: Trying to get property of non-object in dmemcache.inc on line 324
Test _dmemcache_get_pieces() failed: unserialize(): Error at offset 0 of 2006873 bytes in dmemcache.inc on line 329
Test MemCacheSavingCase->checkVariable() failed: Array is saved and restored properly with key npBLtOBuYkK1dhwbU7jGO9kbtRggndRr7sxj0AayMrlyPAZ9wtmNiAXFw3zrGapI7vWKSVtYx9yWXnnafe01uyHXguA0bmlP37OrZ3Gbtpt13LCSEdxvCjU8sAwIQh6U8B2iE9dJuHGn98yVG6sLhtStbQlr22ztDAGwZuAOHZl6zJORpcHFc6sN9v2XzhTWs5a2aHjO6HV4xoaTITZ2UN7WkTVCEz6Kmgt6lc5vcbJGImlRNmvZTjqnDrhrUzNkmMLZSz05WW5ISOH3DGaT4K91uJwDGAxYDDcjeageEGn9. in memcache.test on line 361

Starting test MemcacheSessionTestCase.
Session tests 149 passes, 2 fails, 0 exceptions, and 41 debug messages
Test MemcacheSessionTestCase->testDataPersistence() failed: Memcache sessions are configured correctly. in memcache-session.test on line 87
Test MemcacheSessionTestCase->testEmptyAnonymousSession() failed: Page was cached. in memcache-session.test on line 176

Starting test MemCacheStampedeProtection.
Memcache stampede protection 10 passes, 0 fails, and 0 exceptions
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.

 Group  Class


Starting test MemCacheStatisticsTestCase.
Statistics tests 41 passes, 16 fails, 0 exceptions, and 10 debug messages
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-variables found. in memcache.test on line 950
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-bootstrap_modules found. in memcache.test on line 950
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-lookup_cache found. in memcache.test on line 950
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-system_list found. in memcache.test on line 950
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-module_implements found. in memcache.test on line 950
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-variables found (get). in memcache.test on line 963
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-variables found (set). in memcache.test on line 964
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-bootstrap_modules found (get). in memcache.test on line 963
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-bootstrap_modules found (set). in memcache.test on line 964
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-lookup_cache found (get). in memcache.test on line 963
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-lookup_cache found (set). in memcache.test on line 964
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-system_list found (get). in memcache.test on line 963
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-system_list found (set). in memcache.test on line 964
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-module_implements found (get). in memcache.test on line 963
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Key simpletest185063cache_bootstrap-module_implements found (set). in memcache.test on line 964
Test MemCacheStatisticsTestCase->testBootstrapStatistics() failed: Statistics not present. in memcache.test on line 990
damienmckenna’s picture

FYI I'm also working on the tests in #2543030: Rewrite all time-based checks to use microtime, which has a small handful of test failures left.

jeremy’s picture

Prior to applying this patch:
382 passes, 8 fails, 3 exceptions, and 81 debug messages

After applying this patch:
395 passes, 8 fails, 3 exceptions, and 81 debug messages

It looks like the extra passes are enabling locale, but I'm not seeing any fewer fails.

  • Jeremy committed 348b534 on 7.x-1.x
    Issue #1863996 by Jeremy: Remove session tests
    

  • Jeremy committed b56dfae on 7.x-1.x
    Issue #1863996 by Jeremy: cleanup SESSION variable
    

  • Jeremy committed 8dfa7b3 on 7.x-1.x
    Issue #1863996 by Jeremy: cleanup SESSION variable on each reset
    

  • Jeremy committed 87f2fa3 on 7.x-1.x
    Issue #1863996 by Jeremy: Completeyl remove session tests
    
damienmckenna’s picture

Yeah, I couldn't get the tests to actually pass, there are lots of oddities. I'll try to get some more time to work on them.

jeremy’s picture

With changes committed so far, we're almost there. Just one left:
238 passes, 1 fail, 1 exception, and 40 debug messages

  • Jeremy committed 3c198cf on 7.x-1.x
    Issue #1863996 by Jeremy: cleanup SESSION
    
jeremy’s picture

Status: Needs review » Fixed

I'm not entirely certain my fixes are correct, but all tests are now passing and functionality seems to be correct.

damienmckenna’s picture

Woohoo! :-D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.