summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2023-02-12 08:50:05 +0100
committerAzat Khuzhin <azat@libevent.org>2023-02-12 08:50:05 +0100
commitb5a5fbb81d3dbe961d36fbc29f5bf44f9c3518d0 (patch)
tree6e712bfbc1f5483b8b14ad613d6a5312ccdff618
parentf9134df7d07a9214d00cb0d18d7fd820fa7eb781 (diff)
parentb99106f3fdfc49f7fee68f70188f6138ea65f2cd (diff)
downloadlibevent-b5a5fbb81d3dbe961d36fbc29f5bf44f9c3518d0.tar.gz
Merge branch 'tests-fixes'
* tests-fixes: Add more ignore rules test: fix debug locks in case new lock gots old address test: suppress logs from the tests that produce them under normal circumstances test: fix TT_* flags values Suppress data race for test_ok variable Suppress data race for event_debug_created_threadable_ctx_ variable
-rw-r--r--.gitignore4
-rw-r--r--extra/tsan.supp3
-rw-r--r--test/regress.h4
-rw-r--r--test/regress_bufferevent.c10
-rw-r--r--test/regress_dns.c4
5 files changed, 20 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 0689e9a0..297146dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -142,6 +142,7 @@ LibeventTargets*.cmake
bin/
cmake_install.cmake
Uninstall.cmake
+compile_commands.json
lib/
tmp/
verify_tests.sh
@@ -167,3 +168,6 @@ rules.ninja
/*.tar.gz
/.vagrant
+
+# clangd
+.cache
diff --git a/extra/tsan.supp b/extra/tsan.supp
index 414a12c1..d9b36308 100644
--- a/extra/tsan.supp
+++ b/extra/tsan.supp
@@ -1,2 +1,5 @@
# https://github.com/libevent/libevent/issues/777
race:event_debug_mode_too_late
+race:event_debug_created_threadable_ctx_
+# This is only for tests
+race:test_ok
diff --git a/test/regress.h b/test/regress.h
index d9d2707e..0c0edf55 100644
--- a/test/regress.h
+++ b/test/regress.h
@@ -98,8 +98,8 @@ extern int libevent_tests_running_in_debug_mode;
#define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5)
#define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6)
#define TT_ENABLE_IOCP (TT_ENABLE_IOCP_FLAG|TT_NEED_THREADS)
-#define TT_ENABLE_DEBUG_MODE (TT_ENABLE_IOCP_FLAG<<7)
-#define TT_ENABLE_PRIORITY_INHERITANCE (TT_ENABLE_IOCP_FLAG<<8)
+#define TT_ENABLE_DEBUG_MODE (TT_FIRST_USER_FLAG<<7)
+#define TT_ENABLE_PRIORITY_INHERITANCE (TT_FIRST_USER_FLAG<<8)
/* All the flags that a legacy test needs. */
#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c
index 83cb804b..0775a523 100644
--- a/test/regress_bufferevent.c
+++ b/test/regress_bufferevent.c
@@ -254,10 +254,18 @@ static lock_wrapper *lu_find(void *lock_)
static void *trace_lock_alloc(unsigned locktype)
{
void *lock;
+ lock_wrapper *existing_lock;
+
+ lock = lu_base.cbs.alloc(locktype);
+ existing_lock = lu_find(lock);
+ if (existing_lock) {
+ existing_lock->status = ALLOC;
+ return lock;
+ }
+
++lu_base.nr_locks;
lu_base.locks = realloc(lu_base.locks,
sizeof(lock_wrapper) * lu_base.nr_locks);
- lock = lu_base.cbs.alloc(locktype);
lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 };
return lock;
}
diff --git a/test/regress_dns.c b/test/regress_dns.c
index e28ad52b..ada8b33a 100644
--- a/test/regress_dns.c
+++ b/test/regress_dns.c
@@ -3084,14 +3084,14 @@ struct testcase_t dns_testcases[] = {
{ "tcp_resolve_many_clients", test_tcp_resolve_many_clients,
TT_FORK | TT_NEED_BASE | TT_RETRIABLE, &basic_setup, NULL },
{ "tcp_timeout", test_tcp_timeout,
- TT_FORK | TT_NEED_BASE | TT_RETRIABLE, &basic_setup, NULL },
+ TT_FORK | TT_NEED_BASE | TT_RETRIABLE | TT_NO_LOGS, &basic_setup, NULL },
{ "set_SO_RCVBUF_SO_SNDBUF", test_set_so_rcvbuf_so_sndbuf,
TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
{ "set_options", test_set_option,
TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
{ "set_server_options", test_set_server_option,
- TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
{ "edns", test_edns,
TT_FORK|TT_NEED_BASE, &basic_setup, NULL },