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.

Improve trace pooling process

See original GitHub issue

Problem

When Tracetest triggers a test and waits for the trace to be available, it executes a very simple condition to ensure the trace is complete. Today, the logic is very simple: if a trace is polled twice in a row and the number of spans didn’t change, consider it complete. However, this is not true for long-running operations.

With the current implementation, if we had one test that takes a long time to generate the complete trace, we would have to adjust the pooling configuration to make sure to add enough time between polling executions to prevent false-positive complete traces. However, this would slow down all other tests executed by that tracetest instance.

Possible solution

Enable the polling condition to be set at a test level

Instead of hardcoding the condition, we could let a test define when a trace is complete and can be asserted. If this is not configured in the test, we would use the default implementation.

Test with default polling configuration

When the polling object is not defined, the default polling strategy would be by counting the number of spans and check if they are equal. If they are equal in two subsequent polling executions, the trace is marked as complete.

name: My test
trigger:
    # how to trigger the test

spec:
    # assertions

Test using the same default polling strategy, but with different parameter

name: My test
trigger:
    # how to trigger the test

polling:
    strategy: sameSpanCount
    sameSpanCount:
        executions: 3 # if the number of spans is the same in 3 subsequent executions, the trace is marked as complete

spec:
    # assertions

Test using an assertion to stop polling

# slow-test.yaml
name: My slow test
trigger:
   # how to trigger the test

polling:
   # polling would only stop when a span named "insert pokemon into database" is present in the trace
   strategy: assert
   assert:
       selector: span[name = "insert pokemon into database"
       assertion: tracetest.selected_spans.count = 1

spec:
    # assertions

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kdhamriccommented, Dec 23, 2022

@olha23 Yes, we should. Eventually, we will allow people to define multiple profiles as given above. For that, they would need to be able to specify all the fields: name, strategy, executions, retry delay, and timeout. I am not sure when we will tackle this work - it would not hurt to begin to mock some of it.

0reactions
olha23commented, Dec 22, 2022

@kdhamric from UI perspective we should allow users to define the number of times a trace can be polled before being marked as “complete” in the test configuration?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to troubleshoot J2CA0045E connection pooling problems
Diagnosing The Problem · In the WebSphere Application Server administrative console, expand the Troubleshooting section and click Logs and Trace.
Read more >
How to set up connection pooling trace in WebSphere ...
Swati Kasundra of the IBM WebSphere Application Server L2 team created this video to illustrate how to set up connection pooling trace in ......
Read more >
ODBC Connection pooling - unixODBC
This is a method to increase the connection speed of drivers, but leaving connection's open and reusing them. This document discusses how to...
Read more >
How can I solve a connection pool problem between ASP.NET ...
Use SQL Server Profiler with the SQLProfiler TSQL_Replay template to trace open connections. If you're familiar with Profiler, this method is easier than ......
Read more >
Setting ODBC Connection Pooling Options - Microsoft Learn
This value will increase from zero when you stop all clients on the system and the connections start to time out. ODBC Soft...
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