From f868e1ba13ac97658d4957cdb59f8ef7935043fb Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Sat, 9 Nov 2024 12:23:08 +0100 Subject: [PATCH 1/3] revert sleep time, add more debug to the failed test --- tests/sample/Compute/v2/VolumeAttachmentTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/sample/Compute/v2/VolumeAttachmentTest.php b/tests/sample/Compute/v2/VolumeAttachmentTest.php index 47958a6e..c7f3d604 100644 --- a/tests/sample/Compute/v2/VolumeAttachmentTest.php +++ b/tests/sample/Compute/v2/VolumeAttachmentTest.php @@ -70,7 +70,7 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment) // let's wait for the server to be completely up // https://bugs.launchpad.net/nova/+bug/1998148 // https://bugs.launchpad.net/nova/+bug/1960346 - sleep(30); + sleep(15); require_once $this->sampleFile( 'volume_attachments/delete.php', @@ -85,8 +85,16 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment) $this->assertEquals('available', $volume->status); $server = $this->getService()->getServer(['id' => $createdVolumeAttachment->serverId]); + $server->retrieve(); foreach ($server->listVolumeAttachments() as $volumeAttachment) { - $this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id); + if ($volumeAttachment->volumeId === $createdVolumeAttachment->volumeId) { + print_r($volumeAttachment); + print_r($server); + + $this->fail('Volume attachment was not detached'); + } else { + $this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id); + } } $volume->delete(); From 4f757a1d04becda42955efc3544e9f046416ca5c Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Sat, 9 Nov 2024 12:49:28 +0100 Subject: [PATCH 2/3] more debug --- tests/sample/Compute/v2/VolumeAttachmentTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sample/Compute/v2/VolumeAttachmentTest.php b/tests/sample/Compute/v2/VolumeAttachmentTest.php index c7f3d604..bc40ab00 100644 --- a/tests/sample/Compute/v2/VolumeAttachmentTest.php +++ b/tests/sample/Compute/v2/VolumeAttachmentTest.php @@ -88,6 +88,7 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment) $server->retrieve(); foreach ($server->listVolumeAttachments() as $volumeAttachment) { if ($volumeAttachment->volumeId === $createdVolumeAttachment->volumeId) { + print_r($volume); print_r($volumeAttachment); print_r($server); From e1f9969867894ea98cdd0d3e711b9a9ee2566ed3 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Sat, 9 Nov 2024 13:12:07 +0100 Subject: [PATCH 3/3] add more sleep --- tests/sample/Compute/v2/VolumeAttachmentTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sample/Compute/v2/VolumeAttachmentTest.php b/tests/sample/Compute/v2/VolumeAttachmentTest.php index bc40ab00..62512c94 100644 --- a/tests/sample/Compute/v2/VolumeAttachmentTest.php +++ b/tests/sample/Compute/v2/VolumeAttachmentTest.php @@ -84,6 +84,8 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment) $volume->waitUntil('available', 240); $this->assertEquals('available', $volume->status); + sleep(5); + $server = $this->getService()->getServer(['id' => $createdVolumeAttachment->serverId]); $server->retrieve(); foreach ($server->listVolumeAttachments() as $volumeAttachment) {