Browse Source

Merge pull request #3383 from cognusion/fixes2

Test Fixes: Take 2
Yicheng Qin 10 years ago
parent
commit
4ac4648b5b
3 changed files with 3 additions and 2 deletions
  1. 1 0
      pkg/cors/cors_test.go
  2. 1 1
      raft/rafttest/network_test.go
  3. 1 1
      storage/backend/backend_test.go

+ 1 - 0
pkg/cors/cors_test.go

@@ -117,6 +117,7 @@ func TestCORSHandler(t *testing.T) {
 		}
 		// it is set by http package, and there is no need to test it
 		rr.HeaderMap.Del("Content-Type")
+		rr.HeaderMap.Del("X-Content-Type-Options")
 		if !reflect.DeepEqual(rr.HeaderMap, tt.wheader) {
 			t.Errorf("#%d: header = %+v, want %+v", i, rr.HeaderMap, tt.wheader)
 		}

+ 1 - 1
raft/rafttest/network_test.go

@@ -52,7 +52,7 @@ func TestNetworkDelay(t *testing.T) {
 
 	w := time.Duration(float64(sent)*delayrate/2) * delay
 	// there are pretty overhead in the send call, since it genarete random numbers.
-	if total < w+10*delay {
+	if total < w {
 		t.Errorf("total = %v, want > %v", total, w)
 	}
 }

+ 1 - 1
storage/backend/backend_test.go

@@ -20,7 +20,7 @@ func TestBackendPut(t *testing.T) {
 	batchTx.UnsafeCreateBucket([]byte("test"))
 
 	batchTx.UnsafePut([]byte("test"), []byte("foo"), v)
-	gv := batchTx.UnsafeRange([]byte("test"), v, nil, -1)
+	_, gv := batchTx.UnsafeRange([]byte("test"), v, nil, -1)
 	if !reflect.DeepEqual(gv[0], v) {
 		t.Errorf("v = %s, want %s", string(gv[0]), string(v))
 	}