Skip to content

Commit

Permalink
Add uninstrument test for boto3sqs (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalevr authored Jan 1, 2023
1 parent 3461604 commit 6d1c740
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,27 @@ def test_receive_message(self):
self.assertEqual(attrs["span_id"], link.context.span_id)

self.memory_exporter.clear()

def test_uninstrument(self):
mock_response = {
"MessageId": "123456789",
}

with self._mocked_endpoint(mock_response):
self._client.send_message(
QueueUrl=self._queue_url,
MessageBody="test",
)

spans = self.get_finished_spans()
self.assertEqual(1, len(spans))

self.memory_exporter.clear()
Boto3SQSInstrumentor().uninstrument()

self._client.send_message(
QueueUrl=self._queue_url,
MessageBody="test",
)
spans = self.get_finished_spans()
self.assertEqual(0, len(spans))

0 comments on commit 6d1c740

Please sign in to comment.