From 3d8676cddf9dfcb4b7fca953955aa945d85db6f7 Mon Sep 17 00:00:00 2001 From: Amy Chisholm Date: Mon, 24 Jun 2024 15:11:08 -0700 Subject: [PATCH] test: fixed log error stack message being truncated and failing equality test --- test/unit/api/api-record-log-events.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/api/api-record-log-events.test.js b/test/unit/api/api-record-log-events.test.js index 0bf57a2bac..86a07dd57a 100644 --- a/test/unit/api/api-record-log-events.test.js +++ b/test/unit/api/api-record-log-events.test.js @@ -46,7 +46,11 @@ tap.test('Agent API - recordCustomEvent', (t) => { t.notOk(logMessage['trace.id'], 'it does not have a trace id') t.notOk(logMessage['span.id'], 'it does not have a span id') t.equal(logMessage['error.message'], 'testing error', 'it has the right error.message') - t.equal(logMessage['error.stack'], error.stack, 'it has the right error.stack') + t.equal( + logMessage['error.stack'].substring(0, 1021), + error.stack.substring(0, 1021), + 'it has the right error.stack' + ) t.equal(logMessage['error.class'], 'Error', 'it has the right error.class') const lineMetric = agent.metrics.getMetric(LOGGING.LINES)