Closed timvandermeij closed 5 days ago
/botio integrationtest
Command cmd_integrationtest from @timvandermeij received. Current queue size: 0
Live output at: http://54.193.163.58:8877/28d99334c8f3d5e/output.txt
Command cmd_integrationtest from @timvandermeij received. Current queue size: 0
Live output at: http://54.241.84.105:8877/d8e7a6b9abae7b1/output.txt
Full output at http://54.241.84.105:8877/d8e7a6b9abae7b1/output.txt
Total script time: 7.76 mins
Full output at http://54.193.163.58:8877/28d99334c8f3d5e/output.txt
Total script time: 19.12 mins
Debugging #17931, by printing all parts of the event lifecycle including timestamps, uncovered that some events for which a timeout was logged actually did get triggered correctly in the browser. Going over the code and discovering https://stackoverflow.com/questions/47107465/puppeteer-how-to-listen-to-object-events#comment117661238_65534026 showed what went wrong: if the event we wait for is triggered then
Promise.race
resolves, but that doesn't automatically cancel the timeout. The tests didn't fail on this becausePromise.race
resolved correctly, but slightly later once the timeout was reached we would see spurious log lines about timeouts for the already-triggered events.This commit fixes the issue by canceling the timeout if the event we're waiting for has triggered.
Note that this patch gets rid of the incorrect timeout logs, but this doesn't solve the problem of the correct timeout logs yet (but it's preparatory work for follow-up patches that address that problem).
Fixes a part of #17931.