Skip to content

Commit 034621a

Browse files
committed
Add some logging to a flakey audit test
1 parent e62523a commit 034621a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/object-store/audit.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <realm/list.hpp>
2727
#include <realm/set.hpp>
2828
#include <realm/sync/noinst/client_history_impl.hpp>
29+
#include <realm/util/logger.hpp>
2930

3031
#include <realm/object-store/audit.hpp>
3132
#include <realm/object-store/audit_serializer.hpp>
@@ -42,10 +43,7 @@
4243
#include <realm/object-store/sync/mongo_database.hpp>
4344
#include <realm/object-store/sync/mongo_collection.hpp>
4445

45-
#include <realm/util/logger.hpp>
46-
4746
#include <catch2/catch_all.hpp>
48-
4947
#include <external/json/json.hpp>
5048

5149
using namespace realm;
@@ -71,6 +69,13 @@ struct AuditEvent {
7169
std::map<std::string, std::string> metadata;
7270
};
7371

72+
std::ostream& operator<<(std::ostream& os, const std::vector<AuditEvent>& events) {
73+
for (auto& event : events) {
74+
util::format(os, "%1: %2\n", event.event, event.data);
75+
}
76+
return os;
77+
}
78+
7479
util::Optional<std::string> to_optional_string(StringData sd)
7580
{
7681
return sd ? util::Optional<std::string>(sd) : none;
@@ -1456,6 +1461,7 @@ TEST_CASE("audit management", "[sync][pbs][audit]") {
14561461
audit->wait_for_completion();
14571462

14581463
auto events = get_audit_events(test_session);
1464+
INFO(events);
14591465
REQUIRE(events.size() == 6);
14601466
std::string str = events[0].data.dump();
14611467
// initial

0 commit comments

Comments
 (0)