Commit a597feaf authored by Robert Lubos's avatar Robert Lubos Committed by Dan Kalowsky
Browse files

test: net: lib: prometheus: formatter: Fix test flakiness



If a string is already present in the provided buffer,
prometheus_format_exposition() appends it instead of overwriting,
hence the buffer needs to be cleared on the test start, otherwise it
works by chance.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 130c5c00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ PROMETHEUS_COLLECTOR_DEFINE(test_custom_collector);
ZTEST(test_formatter, test_prometheus_formatter_simple)
{
	int ret;
	char formatted[MAX_BUFFER_SIZE];
	char formatted[MAX_BUFFER_SIZE] = { 0 };
	struct prometheus_counter *counter;
	char exposed[] = "# HELP test_counter Test counter\n"
			 "# TYPE test_counter counter\n"