[ARVADOS] updated: 59b414ff7a625ad3d6e92659b20bdabc6d89e7d4
git at public.curoverse.com
git at public.curoverse.com
Thu Aug 27 17:18:18 EDT 2015
Summary of changes:
services/keepstore/volume_unix.go | 72 +++++++++++++++++++++++-----------
services/keepstore/volume_unix_test.go | 41 ++++++++++++++++++-
2 files changed, 89 insertions(+), 24 deletions(-)
via 59b414ff7a625ad3d6e92659b20bdabc6d89e7d4 (commit)
via 7bedb6e68dc97a4e081217c9a8901c31b7f9e13f (commit)
via 5912867d965664504148f12cff801836a56f0162 (commit)
via 30012ed996dd5336cbfa7394234d1cbbf08a2b78 (commit)
from 9c5d1369b762e55838cc5aa24cdd61ebc079772d (commit)
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.
commit 59b414ff7a625ad3d6e92659b20bdabc6d89e7d4
Merge: 9c5d136 7bedb6e
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Aug 27 17:17:36 2015 -0400
Merge branch '6997-keepstore-mem' refs #6997
commit 7bedb6e68dc97a4e081217c9a8901c31b7f9e13f
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Aug 27 17:14:28 2015 -0400
6997: Fix fencepost error causing race condition in test.
diff --git a/services/keepstore/volume_unix_test.go b/services/keepstore/volume_unix_test.go
index c104d41..ebb8421 100644
--- a/services/keepstore/volume_unix_test.go
+++ b/services/keepstore/volume_unix_test.go
@@ -316,7 +316,7 @@ func TestPutSerialized(t *testing.T) {
}(sem)
// Wait for all goroutines to finish
- for done := 0; done < 2; {
+ for done := 0; done < 3; {
done += <-sem
}
commit 5912867d965664504148f12cff801836a56f0162
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Aug 27 17:10:25 2015 -0400
6997: Add test case for (*UnixVolume)IndexTo().
diff --git a/services/keepstore/volume_unix_test.go b/services/keepstore/volume_unix_test.go
index 6bafa7c..c104d41 100644
--- a/services/keepstore/volume_unix_test.go
+++ b/services/keepstore/volume_unix_test.go
@@ -5,6 +5,9 @@ import (
"fmt"
"io/ioutil"
"os"
+ "regexp"
+ "sort"
+ "strings"
"syscall"
"testing"
"time"
@@ -74,6 +77,42 @@ func TestGetNotFound(t *testing.T) {
}
}
+func TestIndexTo(t *testing.T) {
+ v := TempUnixVolume(t, false, false)
+ defer _teardown(v)
+
+ _store(t, v, TEST_HASH, TEST_BLOCK)
+ _store(t, v, TEST_HASH_2, TEST_BLOCK_2)
+ _store(t, v, TEST_HASH_3, TEST_BLOCK_3)
+
+ buf := new(bytes.Buffer)
+ v.IndexTo("", buf)
+ index_rows := strings.Split(string(buf.Bytes()), "\n")
+ sort.Strings(index_rows)
+ sorted_index := strings.Join(index_rows, "\n")
+ m, err := regexp.MatchString(
+ `^\n`+TEST_HASH+`\+\d+ \d+\n`+
+ TEST_HASH_3+`\+\d+ \d+\n`+
+ TEST_HASH_2+`\+\d+ \d+$`,
+ sorted_index)
+ if err != nil {
+ t.Error(err)
+ } else if !m {
+ t.Errorf("Got index %q for empty prefix", sorted_index)
+ }
+
+ for _, prefix := range []string{"f", "f15", "f15ac"} {
+ buf = new(bytes.Buffer)
+ v.IndexTo(prefix, buf)
+ m, err := regexp.MatchString(`^`+TEST_HASH_2+`\+\d+ \d+\n$`, string(buf.Bytes()))
+ if err != nil {
+ t.Error(err)
+ } else if !m {
+ t.Errorf("Got index %q for prefix %q", string(buf.Bytes()), prefix)
+ }
+ }
+}
+
func TestPut(t *testing.T) {
v := TempUnixVolume(t, false, false)
defer _teardown(v)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list