From f7e374fb3a51bd25e61ae6c4343838a0ca756fba Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 4 Oct 2013 15:36:30 +0200 Subject: [PATCH 1/3] Remove overly spewy Debugf --- devmapper/deviceset_devmapper.go | 1 - 1 file changed, 1 deletion(-) diff --git a/devmapper/deviceset_devmapper.go b/devmapper/deviceset_devmapper.go index 7e151a8a0d..110bfbf1a2 100644 --- a/devmapper/deviceset_devmapper.go +++ b/devmapper/deviceset_devmapper.go @@ -880,7 +880,6 @@ func (devices *DeviceSetDM) SetInitialized(hash string) error { } func (devices *DeviceSetDM) ensureInit() error { - utils.Debugf("ensureInit(). Initialized: %v", devices.initialized) if !devices.initialized { devices.initialized = true if err := devices.initDevmapper(); err != nil { From 9b65c7cf49feacad61cdcd11d2b002319a6b6bae Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 4 Oct 2013 15:38:47 +0200 Subject: [PATCH 2/3] hack: Don't just run the "TestRunHostname" test --- hack/make/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/make/test b/hack/make/test index 1dadbdab8e..10264d9f7f 100644 --- a/hack/make/test +++ b/hack/make/test @@ -11,7 +11,7 @@ bundle_test() { for test_dir in $(find_test_dirs); do ( set -x cd $test_dir - DEBUG=1 go test -v -ldflags "$LDFLAGS" $BUILDFLAGS -run TestRunHostname + DEBUG=1 go test -v -ldflags "$LDFLAGS" $BUILDFLAGS ) done } 2>&1 | tee $DEST/test.log } From aaf1f73bcc2c594f07254a98ff77de3cc6351e92 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 4 Oct 2013 15:47:43 +0200 Subject: [PATCH 3/3] Tests: Initialize devicemapper early to avoid it happening in a test This can take a while and may cause some tests to timeout --- runtime_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime_test.go b/runtime_test.go index 7c12832e30..07765e2d08 100644 --- a/runtime_test.go +++ b/runtime_test.go @@ -147,8 +147,13 @@ func init() { panic(err) } + deviceset := devmapper.NewDeviceSetDM(unitTestStoreDevicesBase) + // Create a device, which triggers the initiation of the base FS + // This avoids other tests doing this and timing out + deviceset.AddDevice("init","") + // Make it our Store root - if runtime, err := NewRuntimeFromDirectory(unitTestStoreBase, devmapper.NewDeviceSetDM(unitTestStoreDevicesBase), false); err != nil { + if runtime, err := NewRuntimeFromDirectory(unitTestStoreBase, deviceset, false); err != nil { panic(err) } else { globalRuntime = runtime