Skip to content

Commit d305fb6

Browse files
authored
revert sleep time, add more debug to the failed test (#418)
fix volume detach test for dalmatian
1 parent 989f5ed commit d305fb6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/sample/Compute/v2/VolumeAttachmentTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment)
7070
// let's wait for the server to be completely up
7171
// https://bugs.launchpad.net/nova/+bug/1998148
7272
// https://bugs.launchpad.net/nova/+bug/1960346
73-
sleep(30);
73+
sleep(15);
7474

7575
require_once $this->sampleFile(
7676
'volume_attachments/delete.php',
@@ -84,9 +84,20 @@ public function testDetach(VolumeAttachment $createdVolumeAttachment)
8484
$volume->waitUntil('available', 240);
8585
$this->assertEquals('available', $volume->status);
8686

87+
sleep(5);
88+
8789
$server = $this->getService()->getServer(['id' => $createdVolumeAttachment->serverId]);
90+
$server->retrieve();
8891
foreach ($server->listVolumeAttachments() as $volumeAttachment) {
89-
$this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id);
92+
if ($volumeAttachment->volumeId === $createdVolumeAttachment->volumeId) {
93+
print_r($volume);
94+
print_r($volumeAttachment);
95+
print_r($server);
96+
97+
$this->fail('Volume attachment was not detached');
98+
} else {
99+
$this->assertNotEquals($createdVolumeAttachment->id, $volumeAttachment->id);
100+
}
90101
}
91102

92103
$volume->delete();

0 commit comments

Comments
 (0)