PragmaticFlow / NBomber

Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
https://nbomber.com
Other
2.07k stars 131 forks source link

Reporting sink: NBomber.Sinks.InfluxDB failed to save final scenario stats #636

Closed kraneitc closed 9 months ago

kraneitc commented 9 months ago

I am attempting to use InfluxDB in an AutoCluster configuration, however I receive an exception when attempting to save final scenario stats.

I have created a repository which can be run to reproduce the issue: https://github.com/kraneitc/NBomberIssue

Exception:

2023-12-05 17:20:27.284 +10:30 [WRN] [ThreadId:26] Reporting sink: NBomber.Sinks.InfluxDB failed to save final scenario stats
InfluxDB.Client.Core.Exceptions.HttpException: Cannot access a disposed object.
Object name: 'System.Net.Http.HttpClient'.
 ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Http.HttpClient'.
   at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request)
   at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at RestSharp.RestClient.ExecuteInternal(RestRequest request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at InfluxDB.Client.Api.Service.WriteService.PostWriteAsyncWithIRestResponse(String org, String bucket, Byte[] body, String zapTraceSpan, String contentEncoding, String contentType, Nullable`1 contentLength, String accept, String orgID, Nullable`1 precision, CancellationToken cancellationToken)
   at InfluxDB.Client.Api.Service.WriteService.PostWriteAsyncWithHttpInfo(String org, String bucket, Byte[] body, String zapTraceSpan, String contentEncoding, String contentType, Nullable`1 contentLength, String accept, String orgID, Nullable`1 precision, CancellationToken cancellationToken)
   at InfluxDB.Client.WriteApiAsync.WritePointsAsync(List`1 points, String bucket, String org, CancellationToken cancellationToken)
   at NBomber.DomainServices.TestHost.ReportingSinks.saveFinalStats@49.MoveNext()

Full log report here: https://github.com/kraneitc/NBomberIssue/blob/master/reports/2023-12-05_06.49.03_session_cb636d49/nbomber-log-20231205.txt

First time raising a bug report here so I apologise in advance if I've missed anything. Please let me know if you need more info.

Briliant package by the way!

AntyaDev commented 9 months ago

Hi @kraneitc

No worries, everything looks good to me. Let me check and play with it.

AntyaDev commented 9 months ago

Hi @kraneitc ,

I have found an issue with disposing of Reporting sinks. I will try to fix it today.

AntyaDev commented 9 months ago

Hi @kraneitc Fixed in v 5.4.1