diff --git a/acceptance/09-resize-server.go b/acceptance/09-resize-server.go
index 558b2cf..b12ef4b 100644
--- a/acceptance/09-resize-server.go
+++ b/acceptance/09-resize-server.go
@@ -10,43 +10,26 @@
 var quiet = flag.Bool("quiet", false, "Quiet mode, for acceptance testing.  $? still indicates errors though.")
 
 func main() {
-	provider, username, password := getCredentials()
 	flag.Parse()
 
-	acc, err := gophercloud.Authenticate(
-		provider,
-		gophercloud.AuthOptions{
-			Username: username,
-			Password: password,
-		},
-	)
-	if err != nil {
-		panic(err)
-	}
+	withIdentity(false, func(acc gophercloud.AccessProvider) {
+		withServerApi(acc, func(api gophercloud.CloudServersProvider) {
+			// These tests are going to take some time to complete.
+			// So, we'll do two tests at the same time to help amortize test time.
+			done := make(chan bool)
+			go resizeRejectTest(api, done)
+			go resizeAcceptTest(api, done)
+			_ = <- done
+			_ = <- done
 
-	api, err := gophercloud.ServersApi(acc, gophercloud.ApiCriteria{
-		Name:      "cloudServersOpenStack",
-		Region:    "DFW",
-		VersionId: "2",
-		UrlChoice: gophercloud.PublicURL,
+			if !*quiet {
+				fmt.Println("Done.")
+			}
+		})
 	})
-	if err != nil {
-		panic(err)
-	}
-
-	// These tests are going to take some time to complete.
-	// So, we'll do two tests at the same time to help amortize test time.
-	done := make(chan bool)
-	go resizeRejectTest(api, done)
-	go resizeAcceptTest(api, done)
-	_ = <- done
-	_ = <- done
-
-	if !*quiet {
-		fmt.Println("Done.")
-	}
 }
 
+// Perform the resize test, but reject the resize request.
 func resizeRejectTest(api gophercloud.CloudServersProvider, done chan bool) {
 	withServer(api, func(id string) {
 		newFlavorId := findAlternativeFlavor()
@@ -55,7 +38,7 @@
 			panic(err)
 		}
 
-		waitForVerifyResize(api, id)
+		waitForServerState(api, id, "VERIFY_RESIZE")
 
 		err = api.RevertResize(id)
 		if err != nil {
@@ -65,6 +48,7 @@
 	done <- true
 }
 
+// Perform the resize test, but accept the resize request.
 func resizeAcceptTest(api gophercloud.CloudServersProvider, done chan bool) {
 	withServer(api, func(id string) {
 		newFlavorId := findAlternativeFlavor()
@@ -73,7 +57,7 @@
 			panic(err)
 		}
 
-		waitForVerifyResize(api, id)
+		waitForServerState(api, id, "VERIFY_RESIZE")
 
 		err = api.ConfirmResize(id)
 		if err != nil {
@@ -83,19 +67,6 @@
 	done <- true
 }
 
-func waitForVerifyResize(api gophercloud.CloudServersProvider, id string) {
-	for {
-		s, err := api.ServerById(id)
-		if err != nil {
-			panic(err)
-		}
-		if s.Status == "VERIFY_RESIZE" {
-			break
-		}
-		time.Sleep(10 * time.Second)
-	}
-}
-
 func withServer(api gophercloud.CloudServersProvider, f func(string)) {
 	id, err := createServer(api, "", "", "", "")
 	if err != nil {
@@ -115,6 +86,13 @@
 
 	f(id)
 
+	// I've learned that resizing an instance can fail if a delete request
+	// comes in prior to its completion.  This ends up leaving the server
+	// in an error state, and neither the resize NOR the delete complete.
+	// This is a bug in OpenStack, as far as I'm concerned, but thankfully,
+	// there's an easy work-around -- just wait for your server to return to
+	// active state first!
+	waitForServerState(api, id, "ACTIVE")
 	err = api.DeleteServerById(id)
 	if err != nil {
 		panic(err)
