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: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
130c5c0002
commit
a597feafb8
1 changed files with 1 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue