Skip to content

Commit

Permalink
revert sleep time, add more debug to the failed test (#418)
Browse files Browse the repository at this point in the history
fix volume detach test for dalmatian
  • Loading branch information
k0ka authored Nov 9, 2024
1 parent 989f5ed commit d305fb6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/sample/Compute/v2/VolumeAttachmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -84,9 +84,20 @@ 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) {
$this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id);
if ($volumeAttachment->volumeId === $createdVolumeAttachment->volumeId) {
print_r($volume);
print_r($volumeAttachment);
print_r($server);

$this->fail('Volume attachment was not detached');
} else {
$this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id);
}
}

$volume->delete();
Expand Down

0 comments on commit d305fb6

Please sign in to comment.