Skip to content

Commit

Permalink
the shitty CI instances definitely can't handle a bandwidth limiter test
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Apr 25, 2024
1 parent ad40ab3 commit 3737ef2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ignore:
- cfg/
- cmd/
- limitio/
- term/

codecov:
Expand Down
23 changes: 10 additions & 13 deletions limitio/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import (
const burst = 1024 // 1KB of burst

func getRates() []float64 {
if testing.Short() {
return []float64{
500 * 1024, // 500KB/sec
1024 * 1024, // 1MB/sec
}
}
return []float64{
500 * 1024, // 500KB/sec
1024 * 1024, // 1MB/sec
Expand All @@ -29,13 +23,6 @@ func getRates() []float64 {
}

func getSources() []*bytes.Reader {
if testing.Short() {
return []*bytes.Reader{
bytes.NewReader(bytes.Repeat([]byte{0}, 64*1024)), // 64KB
bytes.NewReader(bytes.Repeat([]byte{1}, 256*1024)), // 256KB
bytes.NewReader(bytes.Repeat([]byte{2}, 1024*1024)), // 1MB
}
}
return []*bytes.Reader{
bytes.NewReader(bytes.Repeat([]byte{0}, 64*1024)), // 64KB
bytes.NewReader(bytes.Repeat([]byte{1}, 256*1024)), // 256KB
Expand All @@ -44,6 +31,11 @@ func getSources() []*bytes.Reader {
}

func TestRead(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip("skipping test in short mode.")
}

for _, src := range getSources() {
for _, limit := range getRates() {
src.Seek(0, 0)
Expand Down Expand Up @@ -71,6 +63,11 @@ func TestRead(t *testing.T) {
}

func TestWrite(t *testing.T) {
t.Parallel()
if testing.Short() {
t.Skip("skipping test in short mode.")
}

for _, src := range getSources() {
for _, limit := range getRates() {
src.Seek(0, 0)
Expand Down

0 comments on commit 3737ef2

Please sign in to comment.