Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Testing for telemetry #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: telemetry
Choose a base branch
from
Open

Testing for telemetry #616

wants to merge 4 commits into from

Conversation

saishreeeee
Copy link
Collaborator

@saishreeeee saishreeeee commented Jun 25, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Added multithread tests, exception handling tests

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

PECOBLR-584

@saishreeeee saishreeeee self-assigned this Jun 25, 2025
@saishreeeee saishreeeee changed the title added multithreaded tests, exeception handling tests Testing for telemetry Jun 25, 2025


class TestTelemetryRaceConditions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add these in a separate file? @jprakash-db what's the sop in python?

thread.join()

assert len(operation_results) == 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should have some tests where there are concurrently threads executing queries and the telemetry is being captured correctly, is that possible to do?

assert isinstance(client, NoopTelemetryClient)

def test_telemetry_client_factory_mixed_concurrent_operations(self, race_condition_setup):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to have separate tests for this i.e. concurrent_init, concurrent_get, concurrent_flush etc? can we not simply have a larger thread pool and just do all of these in a single test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping separate tests helps in finding which operation specifically is causing the race condition. The test_telemetry_client_factory_mixed_concurrent_operations tests the mixed-operation scenario which is more realistic. So both scenarios (focused on a particular operation and the mixed one) are covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants