YusukeIwaki / capybara-playwright-driver

Playwright driver for Capybara
MIT License
154 stars 13 forks source link

Tests hang intermittently #78

Open patbenatar opened 2 months ago

patbenatar commented 2 months ago

I'm seeing maybe 20% of my CI runs hang indefinitely. I added DEBUG=1 to the CI environment and have collected a couple occurrences. Here are the last handful of lines before the hangs:

One example:

SEND>{:id=>3524, :guid=>"handle@b20d96ccd31c0db2f05ccbf36135de34", :method=>"isEnabled", :params=>{}}
RECV>{"id"=>3524, "result"=>{"value"=>true}}
SEND>{:id=>3525, :guid=>"handle@b20d96ccd31c0db2f05ccbf36135de34", :method=>"isEnabled", :params=>{}}
RECV>{"id"=>3525, "result"=>{"value"=>true}}
SEND>{:id=>3526, :guid=>"handle@b20d96ccd31c0db2f05ccbf36135de34", :method=>"evaluateExpression", :params=>{:expression=>"function(el) {\n  if (el.tagName == 'AREA'){\n    const map_name = document.evaluate('./ancestor::map/@name', el, null, XPathResult.STRING_TYPE, null).stringValue;\n    el = document.querySelector(`img[usemap='\#${map_name}']`);\n    if (!el){\n    return false;\n    }\n  }\n  var forced_visible = false;\n  while (el) {\n    const style = window.getComputedStyle(el);\n    if (style.visibility == 'visible')\n      forced_visible = true;\n    if ((style.display == 'none') ||\n        ((style.visibility == 'hi...", :arg=>{:value=>{:v=>"null"}, :handles=>[]}}}

Another example:

RECV>{"guid"=>"browser-context@cb78b3996bafb73d07b72c3d2e80b2b9", "method"=>"response", "params"=>{"response"=>{"guid"=>"response@c04c0f4925e9e7191e041fb04e94868a"}, "page"=>{"guid"=>"page@1e6eb00957f4016438775746ad55e6b0"}}}
RECV>{"guid"=>"browser-context@cb78b3996bafb73d07b72c3d2e80b2b9", "method"=>"requestFinished", "params"=>{"request"=>{"guid"=>"request@f782197ac96f7df5db159e1555c24170"}, "response"=>{"guid"=>"response@c04c0f4925e9e7191e041fb04e94868a"}, "responseEndTiming"=>273.619, "page"=>{"guid"=>"page@1e6eb00957f4016438775746ad55e6b0"}}}
RECV>{"guid"=>"frame@cb1c6b9d18e0b8810f0f164015d6324c", "method"=>"loadstate", "params"=>{"add"=>"networkidle"}}
RECV>{"guid"=>"frame@aec0a7ded7e92442461a150ce65a077d", "method"=>"loadstate", "params"=>{"add"=>"networkidle"}}

I'd be happy to help debug further or work towards a solution, but I'm not sure where to go from here. Perhaps you can point me in the right direction? Thanks!