[Test] Buy capacity blocks when rendering test configs for manually scheduling tests on CB(p6-b200) - #7532
Merged
Conversation
p6 capacity is only realistically obtainable through capacity blocks, which are an upfront, non-refundable purchase, so test_efa on p6-b200 cannot run in the daily integration tests. A '*_CAPACITY_BLOCK_*' variable now resolves like the existing '*_CAPACITY_RESERVATION_*' ones, except it finds or buys a capacity block and renders to its AZ, so the tests run wherever the capacity turned out to be. A block already owned is reused whatever its state and however little is left of it: it is paid for either way, and a replacement would expire at the same time. Otherwise only 'instant' blocks up to a day long are bought, since blocks end at 11:30 UTC and are priced pro-rata, and rendering then waits for the block to become active. Config validation renders every file under configs/ and must not spend money, hence PCLUSTER_SKIP_CAPACITY_BLOCK_PURCHASE, set by the validate-test-configs tox environment.
hanwen-cluster
previously approved these changes
Aug 6, 2026
PurchaseCapacityBlock answers before the block has been allocated, so the reservation it returns has no AvailabilityZoneId yet. Taking the AZ from that response therefore yielded None, which the caller read as 'no capacity in this region': it moved on to the remaining regions, found nothing, and failed — after the block had been bought, waited for, and seen active. The purchase was wasted. Wait for the block to become active first, and take the AZ from that DescribeCapacityReservations call, which does report it.
hehe7318
enabled auto-merge (squash)
August 7, 2026 18:06
hanwen-cluster
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
p6 capacity is only realistically obtainable through capacity blocks, which are an upfront, non-refundable purchase, so test_efa on p6-b200 cannot run in the daily integration tests. A
*_CAPACITY_BLOCK_*variable now resolves like the existing*_CAPACITY_RESERVATION_*ones, except it finds or buys a capacity block and renders to its AZ, so the tests run wherever the capacity turned out to be.A block already owned is reused whatever its state and however little is left of it: it is paid for either way, and a replacement would expire at the same time. Otherwise only 'instant' blocks up to a day long are bought, since blocks end at 11:30 UTC and are priced pro-rata, and rendering then waits for the block to become active.
Config validation renders every file under configs/ and must not spend money, hence PCLUSTER_SKIP_CAPACITY_BLOCK_PURCHASE, set by the validate-test-configs tox environment.
Tests
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.