From 0f8cb8416ec0f8021bdc00613b220b2773646d96 Mon Sep 17 00:00:00 2001 From: Aliaksei Kandratsenka Date: Mon, 30 Sep 2024 12:23:52 -0400 Subject: [PATCH] [sampling_test] print errno when mkstemp fails I see rare occasional failures there, which look very odd. Typically both sampling and sampling_debug tests fail at about the same time. So hopefully we can diagnose them sometime. --- src/tests/sampling_test.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/sampling_test.cc b/src/tests/sampling_test.cc index 6ea64a9..f127624 100644 --- a/src/tests/sampling_test.cc +++ b/src/tests/sampling_test.cc @@ -163,6 +163,9 @@ struct TempFile { CHECK_EQ(it, path_template.get() + len); int fd = mkstemp(path_template.get()); + if (fd < 0) { + perror("mkstemp"); + } CHECK_GE(fd, 0); return TempFile{fdopen(fd, "r+"), std::string(path_template.get(), len-1)};