diff --git a/contrib/ci/drone-run-router-hive.sh b/contrib/ci/drone-run-router-hive.sh index 29f042b4c..3fb0352cc 100755 --- a/contrib/ci/drone-run-router-hive.sh +++ b/contrib/ci/drone-run-router-hive.sh @@ -1,2 +1,6 @@ #!/usr/bin/env bash -PYTHONPATH=pybind pytest-3 ../test/ +export PYTHONPATH=pybind +rm -f crash.out.txt exit.out.txt +gdb -q -x $(readlink -e $(dirname $0))/gdb-filter.py --args /usr/bin/python3 -m pytest ../test/ +test -e crash.out.txt && cat crash.out.txt +exit $(cat exit.out.txt) diff --git a/llarp/config/config.cpp b/llarp/config/config.cpp index 61619f889..b7dafca41 100644 --- a/llarp/config/config.cpp +++ b/llarp/config/config.cpp @@ -616,8 +616,6 @@ namespace llarp if (not stream or not stream->is_open()) throw std::runtime_error(stringify("Failed to open file ", confFile, " for writing")); - llarp::LogInfo("confStr: ", confStr); - *stream << confStr; stream->flush(); diff --git a/llarp/ev/ev_libuv.cpp b/llarp/ev/ev_libuv.cpp index fcb5456e4..81c6af76b 100644 --- a/llarp/ev/ev_libuv.cpp +++ b/llarp/ev/ev_libuv.cpp @@ -463,28 +463,8 @@ namespace libuv auto* self = static_cast(udp->impl); if (self == nullptr) return -1; - char* data = new char[sz]; - std::copy_n(ptr, sz, data); - uv_buf_t buf = uv_buf_init(data, sz); - uv_udp_send_t* req = new uv_udp_send_t; - req->data = data; - if (uv_udp_send( - req, - &self->m_Handle, - &buf, - 1, - to, - [](uv_udp_send_t* req, int) { - delete[](char*) req->data; - delete req; - }) - != 0) - - { - delete req; - return -1; - } - return 0; + auto buf = uv_buf_init((char*)ptr, sz); + return uv_udp_try_send(&self->m_Handle, &buf, 1, to); } bool diff --git a/test/util/test_llarp_util_decaying_hashset.cpp b/test/util/test_llarp_util_decaying_hashset.cpp index d8fc385f9..3267b276f 100644 --- a/test/util/test_llarp_util_decaying_hashset.cpp +++ b/test/util/test_llarp_util_decaying_hashset.cpp @@ -2,37 +2,6 @@ #include #include -TEST_CASE("Thrash DecayingHashSet", "[decaying-hashset]") -{ - static constexpr auto duration = 5s; - - static constexpr auto decayInterval = 50ms; - llarp::util::DecayingHashSet> hashset(decayInterval); - const llarp_time_t started = llarp::time_now_ms(); - const auto end = duration + started; - llarp_time_t nextDecay = started + decayInterval; - do - { - const auto now = llarp::time_now_ms(); - for (size_t i = 0; i < 500; i++) - { - llarp::AlignedBuffer<32> rando; - rando.Randomize(); - hashset.Insert(rando, now); - /// maybe reinsert to simulate filter hits - if (i % 20 == 0) - hashset.Insert(rando, now); - } - if (now >= nextDecay) - { - REQUIRE(not hashset.Empty()); - hashset.Decay(now); - nextDecay += decayInterval; - } - - } while (llarp::time_now_ms() <= end); -} - TEST_CASE("DecayingHashSet test decay static time", "[decaying-hashset]") { static constexpr auto timeout = 5s;