Explorar o código

Tests: Initialize devicemapper early to avoid it happening in a test

This can take a while and may cause some tests to timeout
Alexander Larsson %!s(int64=11) %!d(string=hai) anos
pai
achega
aaf1f73bcc
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      runtime_test.go

+ 6 - 1
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