Skip to content

[ISSUE-6491]: Fix Error assertion details for InfluxDB Backend Listener #6492

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 1 commit into
base: master
Choose a base branch
from

Conversation

thesaurabhmhaske
Copy link

@thesaurabhmhaske thesaurabhmhaske commented Jul 30, 2025

Description

This PR addresses the issue where the InfluxDB Backend Listener fails to capture detailed error information, particularly assertion failures. The current implementation only creates ErrorMetric objects based on HTTP response codes, completely ignoring assertion failures which results in loss of valuable debugging information.

Key Changes:

  • Enhanced error processing logic in SamplerMetric.add() method to handle both HTTP response failures and assertion failures
  • Added support for creating ErrorMetric objects from AssertionResult with assertion name and failure message
  • Improved error categorization to distinguish between HTTP response errors and assertion errors
  • Added new constructor in ErrorMetric class to handle assertion failures

Motivation and Context

The InfluxDB Backend Listener currently provides limited error information, making it difficult for users to debug test failures. When assertion failures occur, they are completely ignored in error metrics, resulting in:

  • No visibility into specific assertion failure reasons
  • Loss of valuable debugging information
  • Inability to distinguish between different types of assertion failures
  • Poor error analysis capabilities

This fix ensures that all types of errors (HTTP response failures and assertion failures) are properly captured and reported in the InfluxDB metrics, providing complete error visibility for better debugging and monitoring.

Related Issue: ISSUE-6491

How Has This Been Tested?

Testing Environment:

  • JMeter version: 5.6+
  • InfluxDB Backend Listener
  • Test plans with various assertion types

Test Scenarios:

  1. HTTP Response Failures Only: Verified that HTTP response codes and messages are still properly captured
  2. Assertion Failures Only: Tested with Response Assertion, Duration Assertion, and Size Assertion failures
  3. Mixed Failures: Verified behavior when both HTTP response failures and assertion failures occur
  4. Multiple Assertion Failures: Tested scenarios with multiple failed assertions in a single sample
  5. Transaction Controllers: Verified proper error handling with Transaction Controllers and sub-samples
  6. Backward Compatibility: Ensured existing functionality remains intact

Test Results:

  • ✅ Assertion failures now appear in InfluxDB metrics with assertion names and failure messages
  • ✅ HTTP response failures continue to work as before
  • ✅ Error categorization properly distinguishes between assertion and HTTP errors
  • ✅ No regression in existing functionality
  • ✅ Backward compatibility maintained

Screenshots :

Before Fix:
image

After Fix:
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the [code style][style-guide] of this project.
  • I have updated the documentation accordingly.
  • My changes generate no new warnings.
  • I have tested my changes thoroughly.
  • My code is self-documenting where appropriate.
  • I have added comments to my code, particularly in hard-to-understand areas.

Files Modified:

  1. src/components/src/main/java/org/apache/jmeter/visualizers/backend/SamplerMetric.java

    • Enhanced error processing logic in add() method
    • Added assertion failure handling
    • Improved error categorization
  2. src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java

    • Added new constructor for AssertionResult
    • Enhanced error metric creation from assertion failures

@thesaurabhmhaske thesaurabhmhaske changed the title InfluxDB Backend Listener: Limited error information and missing assertion failure details Fix [ISSUE-6491]: Limited error information and missing assertion failure details fix for Influx backend Listener Jul 30, 2025
@thesaurabhmhaske thesaurabhmhaske changed the title [ISSUE-6491]: Limited error information and missing assertion failure details fix for Influx backend Listener [ISSUE-6491]: Fix Error assertion details for InfluxDB Backend Listener Jul 30, 2025
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