diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-13 13:20:13 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-13 13:20:53 +0300 |
commit | 96a75fa5965d92848ac7f7c8c9717f37112caa32 (patch) | |
tree | 052bef9f294fc7aef32dd5a6aa3b9c9e883d0e70 /streamio/stream_test.go | |
parent | 7adbb3678dbfc72dd712405f1b7e3436d29b0052 (diff) |
Add environment variable for streamio buffer size
Diffstat (limited to 'streamio/stream_test.go')
-rw-r--r-- | streamio/stream_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/streamio/stream_test.go b/streamio/stream_test.go index d263a68ab..e4796913d 100644 --- a/streamio/stream_test.go +++ b/streamio/stream_test.go @@ -87,9 +87,9 @@ type opaqueWriter struct { func TestWriterChunking(t *testing.T) { defer func(oldBufferSize int) { - writeBufferSize = oldBufferSize - }(writeBufferSize) - writeBufferSize = 5 + WriteBufferSize = oldBufferSize + }(WriteBufferSize) + WriteBufferSize = 5 testData := "Hello this is some test data" ts := &testSender{} @@ -99,7 +99,7 @@ func TestWriterChunking(t *testing.T) { require.NoError(t, err) require.Equal(t, testData, string(bytes.Join(ts.sends, nil))) for _, send := range ts.sends { - require.True(t, len(send) <= writeBufferSize, "send calls may not exceed writeBufferSize") + require.True(t, len(send) <= WriteBufferSize, "send calls may not exceed WriteBufferSize") } } @@ -116,9 +116,9 @@ func (ts *testSender) send(p []byte) error { func TestReadFrom(t *testing.T) { defer func(oldBufferSize int) { - writeBufferSize = oldBufferSize - }(writeBufferSize) - writeBufferSize = 5 + WriteBufferSize = oldBufferSize + }(WriteBufferSize) + WriteBufferSize = 5 testData := "Hello this is the test data that will be received. It goes on for a while bla bla bla." testCases := []struct { @@ -139,7 +139,7 @@ func TestReadFrom(t *testing.T) { require.Equal(t, int64(len(testData)), n, tc.desc) require.Equal(t, testData, string(bytes.Join(ts.sends, nil)), tc.desc) for _, send := range ts.sends { - require.True(t, len(send) <= writeBufferSize, "send calls may not exceed writeBufferSize") + require.True(t, len(send) <= WriteBufferSize, "send calls may not exceed WriteBufferSize") } } } |