question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CONCURRENCY_PAGE - Only the active Tab (page) is automated (the others is pending, on queue) when using

See original GitHub issue

Hello all,

When I am using CONCURRENCY_PAGE Concurrency implementations I have the following issue.

Only the active tab (page) is automated. The other is waiting for the other to be completed. Lets say GitHub is the latest triggered automation with the Puppeteer image It is active, and everything for its automation is working, but the other 2, yahoo and google are waiting. If I switch manually the tab to let’s say yahoo image it is starting to working there and the others are pending for it to finish

Below you can see a snippet of my code (adjusted with test names)

const args= [
    //https://github.com/puppeteer/puppeteer/issues/1159 || https://github.com/puppeteer/puppeteer/issues/3119
    "--disable-setuid-sandbox",
    "--enable-automation",
    "--disable-browser-side-navigation",
    "--test-type",
    "--start-maximized",
    "--disable-extensions",
    "--disable-popup-blocking",
    "--disable-infobars",
    "--disable-dev-shm-usage",
    "--disable-gpu",
    "--no-sandbox",
    "--disable-features=InfiniteSessionRestore",
    "--enable-features=NetworkService"
];

const options = {
    headless: false,
    w3c: true,
    useAutomationExtension: false,
    executablePath: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
    // executablePath: 'C:/Program Files/Firefox Nightly/firefox.exe',
    // product: 'firefox',
    args
    // acceptInsecureCerts: true,
    // ignoreHTTPSErrors: true
};

   const cluster_test= await Cluster.launch({
        concurrency: Cluster.CONCURRENCY_PAGE,
        monitor: false,
        maxConcurrency: 5,
        puppeteerOptions: options ,
        timeout: 14400000, // 4 hours
        workerCreationDelay: 500, // 0.5 seconds delay
    });


    const automated_process_one= async({ page, data }) => {
        return await callFunction
            .testFunction(page, data)
            .then((result) => {
                return result;
            })
            .catch((error) => {
                return cf.errorCatchCustom1(
                    error.stack,
                    error.message,
                    "Error inside cluster.execute:",
                    "error_log.txt"
                );
            });
    };

app.post("/test", async function(req, res) {
        data = req.body["data"];
                data.url = `https://test..com_` + data['Test'] + '_' +
        try {
            let result = await cluster_test.execute(data, automated_process_one);
            res.send(result);
        } catch (error) {
            res.send(
                cf.errorCatchCustom1(
                    error.stack,
                    error.message,
                    "Error when calling cluster.execute:",
                    "error_log.txt"
                )
            );
        }
    });

My idea here is that the site that I will automate can’t have more than one session, but I will have more than one run with the same credentials (user). I want here to share the data between the browsers (the runs) and this is why I am using CONCURRENCY_PAGE as the other methods are not using shared data at all. I hope someone can assist here, as it is a big issue for me. The main idea is to have them running in parallel, but they are staying in a queue actually.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
deldrid1commented, Sep 17, 2020

If you run with headless: true, then this concurrency works as expected…

1reaction
rileyai-devcommented, Aug 26, 2020

@thomasdondorf I thought the main purpose of CONCURRENCY_PAGE was to run multiple pages in parallel. I reached this limitation with puppeteer and thought that this library could bypass this restriction.

What is the goal of CONCURRENCY_PAGE then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

OPUS FreeFlow User's Manual - Digital Library Systems Group
Opus FreeFlow software allows working only with predefined metadata templates. Right- ... By clicking on the selected tab it becomes the 'active tab'....
Read more >
Administering Server Environments for ... - Oracle Help Center
You can configure the listen address and listen port using the Configuration > General page in the WebLogic Server. Administration Console; the values...
Read more >
Application Performance Monitor User Guide for Version 4.30
Make sure that only fuses with the required rated current and of the specified type are used for replacement. The use of repaired...
Read more >
StreamBase New and Noteworthy Archives
Use the link to open the project's server configuration file. If no configuration file exists for the current project, clicking this link opens...
Read more >
Cisco Wide Area Application Services Configuration Guide
WAAS Compatibility with other Cisco Appliances and Software 2-16 ... The link on this page has the current PGP key ID in use....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found