From 0ebb81ff8769e894dd81e7d212f3b6f9223194d5 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 9 Mar 2026 15:07:23 +0100 Subject: [PATCH] RiuMainWindow: Trigger actual crash in test telemetry - Replace manual telemetry event reporting with an intentional SIGSEGV - This allows for testing the end-to-end crash reporting pipeline and signal handling instead of just simulating telemetry data --- .../UserInterface/RiuMainWindow.cpp | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp index ea8cb03679..edafdf6748 100644 --- a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp @@ -23,7 +23,6 @@ #include "RiaBaseDefs.h" #include "RiaGuiApplication.h" #include "RiaLogging.h" -#include "RiaOpenTelemetryManager.h" #include "RiaPreferences.h" #include "RiaPreferencesSystem.h" #include "RiaRegressionTest.h" @@ -117,6 +116,7 @@ #include #include +#include #include //================================================================================================== @@ -2013,27 +2013,9 @@ void RiuMainWindow::slotExecutePaintEventPerformanceTest() //-------------------------------------------------------------------------------------------------- void RiuMainWindow::slotSendTestTelemetry() { - auto& otelManager = RiaOpenTelemetryManager::instance(); - if ( !otelManager.isEnabled() ) - { - RiaLogging::warning( "OpenTelemetry is not enabled or configured" ); - return; - } - - // Send test logging events - std::map attributes; - attributes["test_type"] = "manual_test"; - attributes["timestamp"] = QDateTime::currentDateTime().toString( Qt::ISODate ).toStdString(); - attributes["user_action"] = "test_menu_triggered"; - attributes["service.name"] = "ResInsight"; - - otelManager.reportEventAsync( "test.logging", attributes ); - - // Generate and send test stack trace - auto testStackTrace = std::stacktrace::current(); - otelManager.reportCrash( 1, testStackTrace ); - - RiaLogging::info( "Test telemetry data sent to OpenTelemetry endpoint" ); + // Intentional crash for testing crash handling / telemetry. + std::raise( SIGSEGV ); + return; } //--------------------------------------------------------------------------------------------------