Merge branch '7159-clean-index' refs #7159 refs #7168
[arvados.git] / services / keepstore / azure_blob_volume_test.go
index c3fea9a80d8be19fc7ab3bf3b01c42196c6147b6..a240c23e1622b525f62a6957a23c025651f94190 100644 (file)
@@ -60,11 +60,11 @@ func newAzStubHandler() *azStubHandler {
 }
 
 func (h *azStubHandler) TouchWithDate(container, hash string, t time.Time) {
-       if blob, ok := h.blobs[container+"|"+hash]; !ok {
+       blob, ok := h.blobs[container+"|"+hash]
+       if !ok {
                return
-       } else {
-               blob.Mtime = t
        }
+       blob.Mtime = t
 }
 
 func (h *azStubHandler) PutRaw(container, hash string, data []byte) {
@@ -339,6 +339,8 @@ func TestAzureBlobVolumeWithGeneric(t *testing.T) {
        http.DefaultTransport = &http.Transport{
                Dial: (&azStubDialer{}).Dial,
        }
+       azureWriteRaceInterval = time.Millisecond
+       azureWriteRacePollTime = time.Nanosecond
        DoGenericVolumeTests(t, func(t *testing.T) TestableVolume {
                return NewTestableAzureBlobVolume(t, false, azureStorageReplication)
        })
@@ -351,6 +353,8 @@ func TestReadonlyAzureBlobVolumeWithGeneric(t *testing.T) {
        http.DefaultTransport = &http.Transport{
                Dial: (&azStubDialer{}).Dial,
        }
+       azureWriteRaceInterval = time.Millisecond
+       azureWriteRacePollTime = time.Nanosecond
        DoGenericVolumeTests(t, func(t *testing.T) TestableVolume {
                return NewTestableAzureBlobVolume(t, true, azureStorageReplication)
        })
@@ -423,7 +427,7 @@ func TestAzureBlobVolumeCreateBlobRaceDeadline(t *testing.T) {
        azureWriteRaceInterval = 2 * time.Second
        azureWriteRacePollTime = 5 * time.Millisecond
 
-       v.PutRaw(TestHash, []byte{})
+       v.PutRaw(TestHash, nil)
 
        buf := new(bytes.Buffer)
        v.IndexTo("", buf)