test: add database stress tests (14 tests, rapid writes, large messages, LMC chains, dedup)
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 31s
CI Code / Code Coverage (pull_request) Successful in 4m1s
CI Code / Linux (debian) (pull_request) Successful in 5m38s
CI Code / Linux (ubuntu) (pull_request) Successful in 5m39s
CI Code / Linux (arch) (pull_request) Successful in 6m7s

This commit is contained in:
2026-03-12 11:13:45 +03:00
parent 71f9ab5007
commit 0d38a0a2cb
6 changed files with 1178 additions and 37 deletions

View File

@@ -354,8 +354,7 @@ init_prof_test(void **state)
/* Pre-write profrc with UI/notification defaults to ensure consistent,
* deterministic output across tests (no timestamps, no roster/occupants
* panels, low input-blocking delay for fast command processing).
* If PROF_FLATFILE=1, also select the flat-file database backend. */
* panels, low input-blocking delay for fast command processing). */
char profrc_path[512];
snprintf(profrc_path, sizeof(profrc_path),
"%s/profanity/profrc", xdg_config_home);
@@ -431,40 +430,6 @@ close_prof_test(void **state)
return 0;
}
void
prof_stop(void)
{
if (fd > 0 && child_pid > 0) {
prof_input("/quit");
sleep_ms(QUIT_GRACE_MS);
close(fd);
fd = 0;
int exited = 0;
for (int i = 0; i < SHUTDOWN_POLL_MAX; i++) {
if (waitpid(child_pid, NULL, WNOHANG) != 0) {
exited = 1;
break;
}
sleep_ms(SHUTDOWN_POLL_MS);
}
if (!exited) {
kill(child_pid, SIGTERM);
for (int i = 0; i < SIGTERM_POLL_MAX; i++) {
if (waitpid(child_pid, NULL, WNOHANG) != 0) { exited = 1; break; }
sleep_ms(SHUTDOWN_POLL_MS);
}
if (!exited) {
kill(child_pid, SIGKILL);
waitpid(child_pid, NULL, 0);
}
}
child_pid = 0;
}
/* Reset output buffer for clean restart */
output_len = 0;
output_buffer[0] = '\0';
}
void
prof_input(const char *input)
{

View File

@@ -15,7 +15,6 @@ int init_prof_test(void** state);
int close_prof_test(void** state);
void prof_start(void);
void prof_stop(void);
void prof_connect(void);
void prof_connect_with_roster(const char* roster);
void prof_input(const char* input);