[mb-commits] branch, beta, updated. Fix deadlock introduced by e37ff0059
MusicBrainz Git Server <[email protected]> Thu, 07 Feb 2013 06:25:28 +0000
| Newsgroups | gmane.comp.audio.musicbrainz.cvs |
|---|---|
| Message-ID | <E1U3KvI-0005yn-9D@wiley> |
The branch, beta has been updated
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=5d3c75e38cc9959fb7cade531951d4ea0cae7895 (commit)
from http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=a981db14dcbd80e583e0a9237fa422fb5422f791 (commit)
Summary of changes:
t/lib/t/MusicBrainz/Server/Data/Edit.pm | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5d3c75e38cc9959fb7cade531951d4ea0cae7895
Author: Oliver Charles <[email protected]>
Date: Thu Feb 7 10:44:12 2013 +0000
Fix deadlock introduced by e37ff0059
In the previous commit, I changed the logic of '->approve' to no longer
lock. This lead to the test assuming that the other lock would eventually be
given up, which isn't the case. I now test get_by_id_and_lock instead, and make
sure that fails to get a lock as we'd expect.
diff --git a/t/lib/t/MusicBrainz/Server/Data/Edit.pm b/t/lib/t/MusicBrainz/Server/Data/Edit.pm
index 64fea93..d11fb42 100644
--- a/t/lib/t/MusicBrainz/Server/Data/Edit.pm
+++ b/t/lib/t/MusicBrainz/Server/Data/Edit.pm
@@ -74,8 +74,7 @@ test 'Test locks on edits' => sub {
$sql2->begin;
$sql2->select_single_row_array('SELECT * FROM edit WHERE id = 12345 FOR UPDATE');
- my $edit = $edit_data->get_by_id(12345);
- like exception { $edit_data->approve($edit, 1) }, qr/could not obtain lock/;
+ like exception { $edit_data->get_by_id_and_lock(12345) }, qr/could not obtain lock/;
# Release the lock
$sql2->rollback;
@@ -172,7 +171,7 @@ $editor = $test->c->model('Editor')->get_by_id($edit->editor_id);
is($editor->rejected_edits, 3, "Edit rejected");
# Test approving edits, successfully this time
-$edit = $edit_data->get_by_id(5);
+$edit = $edit_data->get_by_id_and_lock(5);
$edit_data->approve($edit, 1);
$edit = $edit_data->get_by_id(5);
-----------------------------------------------------------------------
hooks/post-receive
--
mb_server