Commit 1376c993 authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #27412 from liggitt/test-etcd-dir

Automatic merge from submit-queue Allow specifying base location for test etcd data Allows controlling where etcd test data goes. Needed in some environments (like AWS/EBS) to allow putting etcd data on a higher performing volume than /tmp
parents 66d580bf e43e58c7
......@@ -50,6 +50,7 @@ Updated: 5/21/2016
- [Benchmark unit tests](#benchmark-unit-tests)
- [Integration tests](#integration-tests)
- [Install etcd dependency](#install-etcd-dependency)
- [Etcd test data](#etcd-test-data)
- [Run integration tests](#run-integration-tests)
- [Run a specific integration test](#run-a-specific-integration-test)
- [End-to-End tests](#end-to-end-tests)
......@@ -213,6 +214,14 @@ grep -E "image.*etcd" cluster/saltbase/etcd/etcd.manifest # Find version
echo export PATH="$PATH:<LOCATION>" >> ~/.profile # Add to PATH
```
### Etcd test data
Many tests start an etcd server internally, storing test data in the operating system's temporary directory.
If you see test failures because the temporary directory does not have sufficient space,
or is on a volume with unpredictable write latency, you can override the test data directory
for those internal etcd instances with the `TEST_ETCD_DIR` environment variable.
### Run integration tests
The integration tests are run using the `hack/test-integration.sh` script.
......
......@@ -113,7 +113,13 @@ func configureTestCluster(t *testing.T, name string) *EtcdTestServer {
t.Fatal(err)
}
m.CertificatesDir, err = ioutil.TempDir(os.TempDir(), "etcd_certificates")
// Allow test launches to control where etcd data goes, for space or performance reasons
baseDir := os.Getenv("TEST_ETCD_DIR")
if len(baseDir) == 0 {
baseDir = os.TempDir()
}
m.CertificatesDir, err = ioutil.TempDir(baseDir, "etcd_certificates")
if err != nil {
t.Fatal(err)
}
......@@ -138,7 +144,7 @@ func configureTestCluster(t *testing.T, name string) *EtcdTestServer {
}
m.Name = name
m.DataDir, err = ioutil.TempDir(os.TempDir(), "etcd")
m.DataDir, err = ioutil.TempDir(baseDir, "etcd")
if err != nil {
t.Fatal(err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment