Skip to content

Commit d143140

Browse files
authored
Testing cassandra (#344)
fixing bug from customer ticket https://instana.zendesk.com/agent/tickets/23556 * update version
1 parent 6245d48 commit d143140

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

instana/instrumentation/cassandra_inst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def cb_request_finish(results, span, fn):
4747

4848
def cb_request_error(results, span, fn):
4949
collect_response(span, fn)
50-
span.mark_as_errored({"cassandra.error": results.message})
50+
span.mark_as_errored({"cassandra.error": results.summary})
5151
span.finish()
5252

5353

instana/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
# Module version file. Used by setup.py and snapshot reporting.
55

6-
VERSION = '1.36.1'
6+
VERSION = '1.36.2'

tests/clients/test_cassandra-driver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
cluster = Cluster([testenv['cassandra_host']], load_balancing_policy=None)
2020
session = cluster.connect()
2121

22-
session.execute("CREATE KEYSPACE IF NOT EXISTS instana_tests WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};")
22+
session.execute(
23+
"CREATE KEYSPACE IF NOT EXISTS instana_tests WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};")
2324
session.set_keyspace('instana_tests')
2425
session.execute("CREATE TABLE IF NOT EXISTS users("
2526
"id int PRIMARY KEY,"
@@ -203,7 +204,7 @@ def test_execute_error(self):
203204
self.assertEqual(cspan.data["cassandra"]["keyspace"], 'instana_tests')
204205
self.assertIsNone(cspan.data["cassandra"]["achievedConsistency"])
205206
self.assertIsNotNone(cspan.data["cassandra"]["triedHosts"])
206-
self.assertIsNotNone(cspan.data["cassandra"]["error"])
207+
self.assertEqual(cspan.data["cassandra"]["error"], "Syntax error in CQL query")
207208

208209
def test_prepared_statement(self):
209210
prepared = None

tests/requirements-cassandra.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cassandra-driver==3.20.2
1+
cassandra-driver>=3.20.2
22
mock>=2.0.0
33
nose>=1.0
44
pytest>=4.6

0 commit comments

Comments
 (0)