projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
10467: Use context instead of http.CloseNotifier to interrupt buffer waits.
[arvados.git]
/
services
/
keepstore
/
azure_blob_volume_test.go
diff --git
a/services/keepstore/azure_blob_volume_test.go
b/services/keepstore/azure_blob_volume_test.go
index 5d556b3e8c40eb242addf53f4996c49eb396138f..0123bfba5de4457aa9d1d8353e5363477b517fed 100644
(file)
--- a/
services/keepstore/azure_blob_volume_test.go
+++ b/
services/keepstore/azure_blob_volume_test.go
@@
-2,6
+2,7
@@
package main
import (
"bytes"
import (
"bytes"
+ "context"
"crypto/md5"
"encoding/base64"
"encoding/xml"
"crypto/md5"
"encoding/base64"
"encoding/xml"
@@
-365,7
+366,13
@@
func NewTestableAzureBlobVolume(t TB, readonly bool, replication int) *TestableA
}
}
}
}
- v := NewAzureBlobVolume(azClient, container, readonly, replication)
+ v := &AzureBlobVolume{
+ ContainerName: container,
+ ReadOnly: readonly,
+ AzureReplication: replication,
+ azClient: azClient,
+ bsClient: azClient.GetBlobService(),
+ }
return &TestableAzureBlobVolume{
AzureBlobVolume: v,
return &TestableAzureBlobVolume{
AzureBlobVolume: v,
@@
-448,12
+455,12
@@
func TestAzureBlobVolumeRangeFenceposts(t *testing.T) {
data[i] = byte((i + 7) & 0xff)
}
hash := fmt.Sprintf("%x", md5.Sum(data))
data[i] = byte((i + 7) & 0xff)
}
hash := fmt.Sprintf("%x", md5.Sum(data))
- err := v.Put(hash, data)
+ err := v.Put(
context.TODO(),
hash, data)
if err != nil {
t.Error(err)
}
gotData := make([]byte, len(data))
if err != nil {
t.Error(err)
}
gotData := make([]byte, len(data))
- gotLen, err := v.Get(hash, gotData)
+ gotLen, err := v.Get(
context.TODO(),
hash, gotData)
if err != nil {
t.Error(err)
}
if err != nil {
t.Error(err)
}
@@
-494,7
+501,7
@@
func TestAzureBlobVolumeCreateBlobRace(t *testing.T) {
allDone := make(chan struct{})
v.azHandler.race = make(chan chan struct{})
go func() {
allDone := make(chan struct{})
v.azHandler.race = make(chan chan struct{})
go func() {
- err := v.Put(TestHash, TestBlock)
+ err := v.Put(
context.TODO(),
TestHash, TestBlock)
if err != nil {
t.Error(err)
}
if err != nil {
t.Error(err)
}
@@
-504,7
+511,7
@@
func TestAzureBlobVolumeCreateBlobRace(t *testing.T) {
v.azHandler.race <- continuePut
go func() {
buf := make([]byte, len(TestBlock))
v.azHandler.race <- continuePut
go func() {
buf := make([]byte, len(TestBlock))
- _, err := v.Get(TestHash, buf)
+ _, err := v.Get(
context.TODO(),
TestHash, buf)
if err != nil {
t.Error(err)
}
if err != nil {
t.Error(err)
}
@@
-547,7
+554,7
@@
func TestAzureBlobVolumeCreateBlobRaceDeadline(t *testing.T) {
go func() {
defer close(allDone)
buf := make([]byte, BlockSize)
go func() {
defer close(allDone)
buf := make([]byte, BlockSize)
- n, err := v.Get(TestHash, buf)
+ n, err := v.Get(
context.TODO(),
TestHash, buf)
if err != nil {
t.Error(err)
return
if err != nil {
t.Error(err)
return
@@
-570,11
+577,11
@@
func TestAzureBlobVolumeCreateBlobRaceDeadline(t *testing.T) {
}
func (v *TestableAzureBlobVolume) PutRaw(locator string, data []byte) {
}
func (v *TestableAzureBlobVolume) PutRaw(locator string, data []byte) {
- v.azHandler.PutRaw(v.
c
ontainerName, locator, data)
+ v.azHandler.PutRaw(v.
C
ontainerName, locator, data)
}
func (v *TestableAzureBlobVolume) TouchWithDate(locator string, lastPut time.Time) {
}
func (v *TestableAzureBlobVolume) TouchWithDate(locator string, lastPut time.Time) {
- v.azHandler.TouchWithDate(v.
c
ontainerName, locator, lastPut)
+ v.azHandler.TouchWithDate(v.
C
ontainerName, locator, lastPut)
}
func (v *TestableAzureBlobVolume) Teardown() {
}
func (v *TestableAzureBlobVolume) Teardown() {