storage: simplify unit tests
since we control the "server" for these tests, there is no need
for a timeout.
Fixes
@@ -643,19 +643,10 @@ func TestEmptyObjectIterator(t *testing.T) {
t.Fatal(err)
}
it := client.Bucket("b").Objects(ctx, nil)
- c := make(chan error, 1)
- go func() {
- _, err := it.Next()
- c <- err
- }()
- select {
- case err := <-c:
+ _, err = it.Next()
if err != iterator.Done {
t.Errorf("got %v, want Done", err)
}
- case <-time.After(50 * time.Millisecond):
- t.Error("timed out")
- }
}
// Test that BucketIterator's Next method correctly terminates if there is
@@ -673,19 +664,11 @@ func TestEmptyBucketIterator(t *testing.T) {
t.Fatal(err)
}
it := client.Buckets(ctx, "project")
- c := make(chan error, 1)
- go func() {
- _, err := it.Next()
- c <- err
- }()
- select {
- case err := <-c:
+ _, err = it.Next()
if err != iterator.Done {
t.Errorf("got %v, want Done", err)
}
- case <-time.After(500 * time.Millisecond):
- t.Error("timed out")
- }
+
}
func TestCodecUint32(t *testing.T) {
