|
|
|
@ -32,6 +32,7 @@ import (
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var defaultRetry = 100 * time.Millisecond |
|
|
|
|
var baseTmpDir = os.Getenv("BASE_TMP_DIR") |
|
|
|
|
|
|
|
|
|
// retry executes f() n times at each interval until it returns true.
|
|
|
|
|
func retry(t *testing.T, interval time.Duration, n int, f func() bool) { |
|
|
|
@ -109,7 +110,7 @@ func Test_readToEnd_noCheckpoint(t *testing.T) {
|
|
|
|
|
const seriesCount = 10 |
|
|
|
|
const samplesCount = 250 |
|
|
|
|
|
|
|
|
|
dir, err := ioutil.TempDir("", "readToEnd_noCheckpoint") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "readToEnd_noCheckpoint") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
wdir := path.Join(dir, "wal") |
|
|
|
@ -172,7 +173,7 @@ func Test_readToEnd_withCheckpoint(t *testing.T) {
|
|
|
|
|
const seriesCount = 10 |
|
|
|
|
const samplesCount = 250 |
|
|
|
|
|
|
|
|
|
dir, err := ioutil.TempDir("", "readToEnd_withCheckpoint") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "readToEnd_withCheckpoint") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
|
|
|
|
@ -255,7 +256,7 @@ func Test_readCheckpoint(t *testing.T) {
|
|
|
|
|
const seriesCount = 10 |
|
|
|
|
const samplesCount = 250 |
|
|
|
|
|
|
|
|
|
dir, err := ioutil.TempDir("", "readCheckpoint") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "readCheckpoint") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
|
|
|
|
@ -317,7 +318,7 @@ func Test_checkpoint_seriesReset(t *testing.T) {
|
|
|
|
|
const seriesCount = 10 |
|
|
|
|
const samplesCount = 250 |
|
|
|
|
|
|
|
|
|
dir, err := ioutil.TempDir("", "seriesReset") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "seriesReset") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
|
|
|
|
@ -382,7 +383,7 @@ func Test_checkpoint_seriesReset(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func Test_decodeRecord(t *testing.T) { |
|
|
|
|
dir, err := ioutil.TempDir("", "decodeRecord") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "decodeRecord") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
|
|
|
|
@ -407,7 +408,7 @@ func Test_decodeRecord(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func Test_decodeRecord_afterStart(t *testing.T) { |
|
|
|
|
dir, err := ioutil.TempDir("", "decodeRecord") |
|
|
|
|
dir, err := ioutil.TempDir(baseTmpDir, "decodeRecord") |
|
|
|
|
testutil.Ok(t, err) |
|
|
|
|
defer os.RemoveAll(dir) |
|
|
|
|
|
|
|
|
|