Giter VIP home page Giter VIP logo

Comments (3)

GCheung55 avatar GCheung55 commented on September 8, 2024

++

The same issue occurs if the setTimeout wraps remote.get in my scenario.

I'm using [email protected] in Buster.JS's test runner to drive embedded Chromium. It's possible that webdriver code is executed in a setTimeout or some other delayed mechanism in the test runner.

from selenium.

GCheung55 avatar GCheung55 commented on September 8, 2024

I did some digging and so far I've only determined that reverting back to https://github.com/SeleniumHQ/selenium/blob/ecfefd32aba140f79f62986b0c7944c197c3ff03/javascript/webdriver/promise.js allows the code to continue.

from selenium.

jleyba avatar jleyba commented on September 8, 2024

Problem is the flow gets confused and deadlocks itself when a command is scheduled asynchronously when there's a dependency on the running task. Basic repo case:

var selenium = require('selenium-webdriver');
var flow = selenium.promise.controlFlow();

var task1 = flow.execute(function() {
  console.log('Inside task 1:\n' + flow);
  return selenium.promise.delayed(10);
}, 'task 1');

setTimeout(function() {
  flow.execute(function() {
    console.log('Inside task 2:\n' + flow);
    return task1;  // Create dependency on task 1 result.
  }, 'task 2');
  console.log('Scheduled task 2:\n' + flow);
}, 0);

flow.once('idle', function() {
  console.log('All done');
});

Output:

Inside task 1:
ControlFlow::1
| Frame::4
| | (pending) Task::3<task 1>
| | | (active) Frame::5
Scheduled task 2:
ControlFlow::1
| Frame::4
| | (pending) Task::3<task 1>
| | | (active) Frame::5
| | | | Task::12<task 2>
Inside task 2:
ControlFlow::1
| Frame::4
| | (pending) Task::3<task 1>
| | | Frame::5
| | | | (pending) Task::12<task 2>
| | | | | (active) Frame::13

Need to update the flow to differentiate between this and legit sub-commands.

from selenium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.