fix(lambda): await idle capacity before comparing restored pool status (#8501)

ProvisionedConcurrencyPoolTest's restart case compared the status get()
and list() report right after the configuration turned READY, while its
two initializers could still be adding their handles to the idle queue,
so the two snapshots could disagree on the available count. It now
waits until both requested environments are available before comparing.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Jackson PriceandAndre Kurait authored and GitHub committed 2026-11-15 16:21:49 -04:00
1 parent c1c8b84a1f
commit d5f6ae23a4
1 file changed
+2
@@ -1465,6 +1465,8 @@ class ProvisionedConcurrencyPoolTest {
launched().initialized.complete(null);
launched().initialized.complete(null);
ready();
await().atMost(Duration.ofSeconds(5)).pollDelay(Duration.ZERO)
.pollInterval(Duration.ofMillis(10)).until(() -> get().available() == 2);
assertEquals(get(), pool.list(REGION, "example", ACCOUNT, null, null).items().getFirst().status());
} else if (restart == 1) {
assertEquals(2, get().requested());