Commit 7c32d874503ee43206cb5d2a8e65dbe23f18eaca

Carlos Martín Nieto 2016-03-10T12:27:07

refdb: expect threaded test deletes to race At times we may try to delete a reference which a different thread has already taken care of.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/tests/threads/refdb.c b/tests/threads/refdb.c
index 0c5cd2b..d8dc77b 100644
--- a/tests/threads/refdb.c
+++ b/tests/threads/refdb.c
@@ -104,6 +104,10 @@ static void *delete_refs(void *arg)
 			do {
 				error = git_reference_delete(ref);
 			} while (error == GIT_ELOCKED);
+			/* Sometimes we race with other deleter threads */
+			if (error == GIT_ENOTFOUND)
+				error = 0;
+
 			cl_git_pass(error);
 			git_reference_free(ref);
 		}