Skip to content

Commit 8b2bdb0

Browse files
committed
fix(provider-webdriver): keep a releasing lease owned until disposal ends
A release took a lease out of the manager's map and then waited on the hub, so a fresh allocation in that window saw a free lease and rented a second billed session the release never saw, and a shutdown that arrived there answered with the first session still live. A repeated allocation validated its flags after reading the live session, so a teardown landing inside that await left the caller told the lease was held by a session that no longer existed. A shutdown whose DELETE was refused reported a clean close, and the allocation refused for that session was told nothing needed cleaning up. A lease entry now keeps owning its session while it is being ended: the take and the one disposal it starts are recorded in the same synchronous step, the entry leaves the map only once that disposal settles, and a second release or a shutdown joins it. An allocation reports the disposal it waited on, naming the session and whether its end is confirmed, pending, or failed; a shutdown that could not stop a session now fails the way a plugin cleanup failure is reported at close. Every allocation is refused for its own refused profile flags before it joins or publishes anything.
1 parent 0f58d95 commit 8b2bdb0

3 files changed

Lines changed: 733 additions & 215 deletions

File tree

‎packages/provider-webdriver/src/profile-fields.fixtures.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@ export function consumedProfileFields({ fields }: ProviderProfileFieldDeclaratio
4040
.filter((field) => fields[field] === 'consumed')
4141
.sort();
4242
}
43+
44+
/** A hub that reads none of the profile fields, so every one of them is refused. */
45+
export function refuseAllProfileFields(provider: string): ProviderProfileFieldDeclaration {
46+
const consumed = consumeAllProfileFields(provider);
47+
return {
48+
provider,
49+
label: consumed.label,
50+
fields: Object.fromEntries(
51+
(Object.keys(consumed.fields) as ProviderProfileField[]).map((field) => [field, 'refused']),
52+
) as Record<ProviderProfileField, 'refused'>,
53+
};
54+
}

0 commit comments

Comments
 (0)