mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
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:
parent
2cb7d30603
commit
d9cb7453fb
6 changed files with 22 additions and 16 deletions
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
|
@ -101,12 +101,23 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd ${GITHUB_WORKSPACE}/build
|
cd ${GITHUB_WORKSPACE}/build
|
||||||
echo Run ctest -V -L DFLY
|
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
|
GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY
|
||||||
|
|
||||||
echo "Running tests with --force_epoll"
|
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
|
FLAGS_force_epoll=true ctest -V -L DFLY
|
||||||
|
|
||||||
|
echo "Finished running tests with --force_epoll"
|
||||||
|
|
||||||
echo "Running tests with --cluster_mode=emulated"
|
echo "Running tests with --cluster_mode=emulated"
|
||||||
FLAGS_cluster_mode=emulated ctest -V -L DFLY
|
FLAGS_cluster_mode=emulated ctest -V -L DFLY
|
||||||
|
|
||||||
|
|
2
helio
2
helio
|
@ -1 +1 @@
|
||||||
Subproject commit 3586e6b03fd10893bc0980104d8d5ebf03cd5c88
|
Subproject commit 3b3bc22b8af3fd5747836bf029b197a319679491
|
|
@ -27,7 +27,7 @@ constexpr size_t kSizeConnStats = sizeof(ConnectionStats);
|
||||||
|
|
||||||
ConnectionStats& ConnectionStats::operator+=(const ConnectionStats& o) {
|
ConnectionStats& ConnectionStats::operator+=(const ConnectionStats& o) {
|
||||||
// To break this code deliberately if we add/remove a field to this struct.
|
// 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(read_buf_capacity);
|
||||||
ADD(dispatch_queue_entries);
|
ADD(dispatch_queue_entries);
|
||||||
|
|
|
@ -503,13 +503,10 @@ void AclFamily::GenPass(CmdArgList args, ConnectionContext* cntx) {
|
||||||
constexpr size_t step_size = sizeof(decltype(std::random_device::max()));
|
constexpr size_t step_size = sizeof(decltype(std::random_device::max()));
|
||||||
std::string response;
|
std::string response;
|
||||||
for (size_t bytes_written = 0; bytes_written < result_length; bytes_written += step_size) {
|
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) {
|
response.resize(result_length);
|
||||||
const size_t stride = response.size() - result_length;
|
|
||||||
response.erase(response.end() - stride, response.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
(*cntx)->SendSimpleString(response);
|
(*cntx)->SendSimpleString(response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,18 +192,16 @@ template <typename RandGen> std::string GetRandomHex(RandGen& gen, size_t len) {
|
||||||
size_t indx = 0;
|
size_t indx = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < len / 16; ++i) { // 2 chars per byte
|
for (size_t i = 0; i < len / 16; ++i) { // 2 chars per byte
|
||||||
absl::AlphaNum an(absl::Hex(gen(), absl::kZeroPad16));
|
absl::numbers_internal::FastHexToBufferZeroPad16(gen(), res.data() + indx);
|
||||||
|
indx += 16;
|
||||||
for (unsigned j = 0; j < 16; ++j) {
|
|
||||||
res[indx++] = an.Piece()[j];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indx < res.size()) {
|
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++) {
|
for (unsigned j = 0; indx < res.size(); indx++, j++) {
|
||||||
res[indx] = an.Piece()[j];
|
res[indx] = buf[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ auto CmdEntryToMonitorFormat(std::string_view str) -> std::string {
|
||||||
if (isprint(c)) {
|
if (isprint(c)) {
|
||||||
result += c;
|
result += c;
|
||||||
} else {
|
} else {
|
||||||
absl::StrAppend(&result, "\\x", absl::Hex((unsigned char)c, absl::kZeroPad2));
|
absl::StrAppendFormat(&result, "\\x%02x", c);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue