wrap dragonfly_test with gdb inside a CI (#2050)

chore: run dragonfly_test with epoll under gdb

Also, update helio that provide a stacktrace under musl libc (alpine linux).
This version of helio updates absl version as well.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2023-10-22 20:05:27 +03:00 committed by GitHub
parent 2cb7d30603
commit d9cb7453fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 16 deletions

View file

@ -101,12 +101,23 @@ jobs:
run: |
cd ${GITHUB_WORKSPACE}/build
echo Run ctest -V -L DFLY
#GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1
GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY
echo "Running tests with --force_epoll"
# Create a rule that automatically prints stacktrace upon segfault
cat > ./init.gdb <<EOF
catch signal SIGSEGV
command
bt
end
EOF
gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
FLAGS_force_epoll=true ctest -V -L DFLY
echo "Finished running tests with --force_epoll"
echo "Running tests with --cluster_mode=emulated"
FLAGS_cluster_mode=emulated ctest -V -L DFLY

2
helio

@ -1 +1 @@
Subproject commit 3586e6b03fd10893bc0980104d8d5ebf03cd5c88
Subproject commit 3b3bc22b8af3fd5747836bf029b197a319679491

View file

@ -27,7 +27,7 @@ constexpr size_t kSizeConnStats = sizeof(ConnectionStats);
ConnectionStats& ConnectionStats::operator+=(const ConnectionStats& o) {
// To break this code deliberately if we add/remove a field to this struct.
static_assert(kSizeConnStats == 144u);
static_assert(kSizeConnStats == 136u);
ADD(read_buf_capacity);
ADD(dispatch_queue_entries);

View file

@ -503,13 +503,10 @@ void AclFamily::GenPass(CmdArgList args, ConnectionContext* cntx) {
constexpr size_t step_size = sizeof(decltype(std::random_device::max()));
std::string response;
for (size_t bytes_written = 0; bytes_written < result_length; bytes_written += step_size) {
absl::StrAppend(&response, absl::Hex(urandom(), absl::kZeroPad8));
absl::StrAppendFormat(&response, "%08x", urandom());
}
if (response.size() > result_length) {
const size_t stride = response.size() - result_length;
response.erase(response.end() - stride, response.end());
}
response.resize(result_length);
(*cntx)->SendSimpleString(response);
}

View file

@ -192,18 +192,16 @@ template <typename RandGen> std::string GetRandomHex(RandGen& gen, size_t len) {
size_t indx = 0;
for (size_t i = 0; i < len / 16; ++i) { // 2 chars per byte
absl::AlphaNum an(absl::Hex(gen(), absl::kZeroPad16));
for (unsigned j = 0; j < 16; ++j) {
res[indx++] = an.Piece()[j];
}
absl::numbers_internal::FastHexToBufferZeroPad16(gen(), res.data() + indx);
indx += 16;
}
if (indx < res.size()) {
absl::AlphaNum an(absl::Hex(gen(), absl::kZeroPad16));
char buf[32];
absl::numbers_internal::FastHexToBufferZeroPad16(gen(), buf);
for (unsigned j = 0; indx < res.size(); indx++, j++) {
res[indx] = an.Piece()[j];
res[indx] = buf[j];
}
}

View file

@ -212,7 +212,7 @@ auto CmdEntryToMonitorFormat(std::string_view str) -> std::string {
if (isprint(c)) {
result += c;
} else {
absl::StrAppend(&result, "\\x", absl::Hex((unsigned char)c, absl::kZeroPad2));
absl::StrAppendFormat(&result, "\\x%02x", c);
}
break;
}