Giter Site home page Giter Site logo

Comments (8)

joerg1985 avatar joerg1985 commented on September 13, 2024 1

The CDP events are processed concurrently by different threads, i think this will destory the order.

Other areas rely on this, e.g. the NetworkInterceptor:
One thread will wait here for another thread to complete the future:
https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/devtools/idealized/Network.java#L242
And this is the line where the other thread does complete the future:
https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/devtools/idealized/Network.java#L226

from selenium.

joerg1985 avatar joerg1985 commented on September 13, 2024 1

@pujagani this is a very special case, so i would empower the listener to handle this, e.g. like in the PR i will raise in the next minutes.

from selenium.

github-actions avatar github-actions commented on September 13, 2024

@zixinyin, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

from selenium.

pujagani avatar pujagani commented on September 13, 2024

Thank you for the details. Have you checked the logs to ensure that the events are returned in order from CDP itself? Can you please share the debug logs here. Thank you!

from selenium.

pujagani avatar pujagani commented on September 13, 2024

Makes sense. Thank you @joerg1985! So what should be done regarding this issue?

from selenium.

pujagani avatar pujagani commented on September 13, 2024

Thank you for the PR! It looks good to me.

from selenium.

joerg1985 avatar joerg1985 commented on September 13, 2024

@zixinyin Starting with the next release it is possible to register a two argument listener, to sort the data:

TreeMap<Long, String> chunks = new TreeMap<>();
devTools.addListener(HeapProfiler.addHeapSnapshotChunk(), chunks::put);
devTools.send(HeapProfiler.takeHeapSnapshot(Optional.of(false), Optional.of(false), Optional.of(false), Optional.of(false)));
try (FileWriter fileWriter = new FileWriter("dump.json")) {
  for (String chunk : chunks.values()) {
     fileWriter.write(chunk);
  }
}

from selenium.

github-actions avatar github-actions commented on September 13, 2024

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

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.