Skip to content

Handle malformed URI exceptions without breaking JMeter thread#51

Merged
Baraujo25 merged 2 commits into
masterfrom
development
Jun 9, 2026
Merged

Handle malformed URI exceptions without breaking JMeter thread#51
Baraujo25 merged 2 commits into
masterfrom
development

Conversation

@Baraujo25

Copy link
Copy Markdown
Collaborator

This pull request improves the robustness of the video streaming HTTP client and sampler by ensuring that invalid or unresolved URIs are handled gracefully. Instead of throwing uncaught exceptions that could disrupt test execution and clutter logs, the code now records failed sample results for invalid URIs, making error handling more consistent and measurable. The changes also introduce new unit tests to verify this behavior.

Error handling improvements:

  • The VideoStreamingHttpClient now checks if a URI is null or not absolute in downloadUri. If so, it returns a failed HTTPSampleResult using the new buildInvalidUriResult method, instead of throwing an uncaught IllegalArgumentException. This ensures that URI errors are reported as failed samples, not as raw stack traces. [1] [2]
  • The VideoStreamingSampler now catches IllegalArgumentException when the master URL is not a valid URI reference, logs a warning, and records a failed sample result, instead of aborting with an exception.

Testing and validation:

  • Added VideoStreamingHttpClientTest with tests to verify that invalid, relative, or null URIs result in failed sample results, not exceptions.
  • Added a test in HlsSamplerTest to ensure that an unresolved dynamic master URL variable (with illegal URI characters) is recorded as a failed master sample, not as an exception.

Baraujo25 and others added 2 commits June 8, 2026 22:20
Prevent the exception like URI is not absolute due to the resolution of
a malformed URI to be reported all the way up to Jmeter causing thread
to be stopped. Platforms like Blazemeter often stop test execution due
to errors like this.
Wrap exception as sample result error instead of breaking JMeter thread
@Baraujo25 Baraujo25 merged commit a5887cf into master Jun 9, 2026
3 checks passed
@Baraujo25 Baraujo25 deleted the development branch June 9, 2026 01:30
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.

1 participant