mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: wait for WebDriver BiDi browser to close gracefully (#11636)
This commit is contained in:
parent
e8b501de6f
commit
cc3aeeb6ea
@ -16,6 +16,13 @@ import {
|
||||
computeExecutablePath,
|
||||
} from '@puppeteer/browsers';
|
||||
|
||||
import {
|
||||
firstValueFrom,
|
||||
from,
|
||||
map,
|
||||
race,
|
||||
timer,
|
||||
} from '../../third_party/rxjs/rxjs.js';
|
||||
import type {Browser, BrowserCloseCallback} from '../api/Browser.js';
|
||||
import {CdpBrowser} from '../cdp/Browser.js';
|
||||
import {Connection} from '../cdp/Connection.js';
|
||||
@ -236,7 +243,17 @@ export abstract class ProductLauncher {
|
||||
await browserProcess.close();
|
||||
}
|
||||
} else {
|
||||
await browserProcess.close();
|
||||
// Wait for a possible graceful shutdown.
|
||||
await firstValueFrom(
|
||||
race(
|
||||
from(browserProcess.hasClosed()),
|
||||
timer(5000).pipe(
|
||||
map(() => {
|
||||
return from(browserProcess.close());
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2293,12 +2293,6 @@
|
||||
"parameters": ["firefox", "webDriverBiDi"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir option should restore state",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["firefox", "webDriverBiDi"],
|
||||
"expectations": ["SKIP"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[locator.spec] Locator Locator.click should work with a OOPIF",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
Loading…
Reference in New Issue
Block a user