"The branch inserted by the test is in the database." and "The branch inserted by the test is the only branch in the database." currently fail. I've narrowed this down to the branch delete of refs/heads/enhancements not being reflected in $this->repo->loadBranches();. As far as I can tell, the delete does happen in the test repo, but the entity cache of the branch remains.

CommentFileSizeAuthor
#7 2181077.diff560 bytesdrumm
#6 2169079.diff1.93 KBdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tvn’s picture

Issue tags: +Drupal.org 7.1
drumm’s picture

Changing the call in testBranchOffAndDelete() from

$branches = $this->repo->loadBranches();

to

$branches = $this->repo->loadBranches(array(), array(), array('may cache' => FALSE));

Makes the test succeed, so I think that confirms it is a caching issue.

drumm’s picture

A call to $this->repository->loadBranches() in VersioncontrolGitRepositoryHistorySynchronizerDefault::syncEvent() after the enhancements branch is deleted does correctly show only newbranch remaining.

Maybe it is possible the tests somehow have a different repository object.

drumm’s picture

I confirmed the test and VersioncontrolGitRepositoryHistorySynchronizerDefault::syncEvent() have the same repository object. So, enhancements somehow gets added back by the time the test checks it.

drumm’s picture

The cached repo comes back with

$this->getBackend()->restoreControllerCachingDefaults();

in VersioncontrolRepository::syncEvent(). So, when disableControllerCaching() becomes active, the cache should still be able to be invalidated.

drumm’s picture

Project: Version Control API -- Git backend » Version Control API
Component: Code » API - Entity Controllers
Status: Active » Needs review
FileSize
1.93 KB

This patch resets the cache when restoreControllerCachingDefaults() is called. I think it is best to clear it all since anything could have changed while caching is off.

drumm’s picture

FileSize
560 bytes

(correct patch)

The last submitted patch, 6: 2169079.diff, failed testing.

marvil07’s picture

Title: Fix failing Git event data integrity tests » Invalid cache on restoring cache controller settings
Status: Needs review » Fixed

Thanks for the fix!

Added to 7.x-1.x.

drumm’s picture

Deployed to Drupal.org.

Status: Fixed » Closed (fixed)

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

  • Commit 3bd8e8d on 7.x-1.x, drush-vc-sync-unlock authored by drumm, committed by marvil07:
    Issue #2181077 by drumm: Reset cache on restoring cache controller...

  • Commit 3bd8e8d on 7.x-1.x authored by drumm, committed by marvil07:
    Issue #2181077 by drumm: Reset cache on restoring cache controller...