Skip to content

Commit

Permalink
make test more reliable and faster
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Apr 3, 2019
1 parent 1e5f6c7 commit 1d40148
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2946,8 +2946,8 @@ func TestValuerWithValueReceiverGivenNilValue(t *testing.T) {
// call to `Rows.Close`, so Context cancellation should **not** invalidate the backing buffers.
func TestRawBytesAreNotModified(t *testing.T) {
const blob = "abcdefghijklmnop"
const contextRaceIterations = 10
const blobSize = 3000
const contextRaceIterations = 20
const blobSize = defaultBufSize * 3 / 4 // Second row overwrites first row.
const insertRows = 4

var sqlBlobs = [2]string{
Expand Down Expand Up @@ -2981,11 +2981,11 @@ func TestRawBytesAreNotModified(t *testing.T) {
before := string(raw)
// Ensure cancelling the query does not corrupt the contents of `raw`
cancel()
time.Sleep(5 * time.Millisecond)
time.Sleep(time.Microsecond * 100)
after := string(raw)

if before != after {
t.Fatal("the backing storage for sql.RawBytes has been modified")
t.Fatalf("the backing storage for sql.RawBytes has been modified (i=%v)", i)
}
}
rows.Close()
Expand Down

0 comments on commit 1d40148

Please sign in to comment.