Commit Graph

85 Commits

Author SHA1 Message Date
b1d820462a feat(bench): synthetic load harness for flat-file backend (P1-P5)
End-to-end performance and correctness harness for the flat-file +
SQLite database backends. Lives in tests/bench/, built only on
demand (`make bench`); not part of `make check`.

Components

  gen_history (P1)
    Deterministic corpus generator. Knobs: lines, contacts, years,
    seed, stanza-id mode (uuid/libpurple/conversations/mixed), LMC
    rate, MAM-OOO rate, resources/contact, length profile
    (short/mixed/long/extreme). Emits the canonical
    flatlog/<account>/<contact>/history.log layout used by
    ff_verify_integrity. ~340 LOC.

  bench_runner (P1, P2.5)
    S1 cold tail-access via sparse index
    S2 warm tail-access (page cache hot)
    S3 deep pagination (1000 binary-search lookups)
    S4 first-time index build (cold file -> ff_state_ensure_fresh)
    S5 incremental extend (asserts no full rebuild path)
    S6 real ff_verify_integrity over the contact tree
    Reports total/err/warn/info issue counts in the CSV note.

  bench_long_messages (P2)
    L1-L14 long-message stress: 1KB up to 9.9MB bodies, plus
    oversized line rejection (10MB+1 -> ff_readline returns ""),
    embedded-newline / pipe / emoji body patterns, full parse on
    100x1MB, 1000x100KB sustained append.

  bench_failure_modes (P3)
    F1-F15 failure-injection: truncated last line, mid-file CRLF,
    mid-file BOM, LMC cycle, LMC depth>FF_MAX_LMC_DEPTH, manual
    ': ' in resource, RTL/ZWSP, Latin-1 byte, empty body,
    mtime/inode flip, empty file. Each test asserts expected issue
    levels and reports PASS/FAIL.

  bench_export_import (P5)
    Links real database_export.c + database_sqlite.c + database.c
    and drives log_database_export_to_flatfile /
    log_database_import_from_flatfile under load.
    Subcommands: seed, export, import, roundtrip, verify.
    S7a/b export, S8a/b import, S8e roundtrip with full byte-by-byte
    content diff of every row in (from_jid, to_jid, message,
    timestamp, type, stanza_id, archive_id, encryption, replace_id).

Make targets

  bench-quick / bench / bench-full
  bench-longmsg, bench-failure
  bench-multicontact, bench-lmc, bench-ooo
  bench-export, bench-import, bench-roundtrip
  bench-pipeline, bench-pipeline-max (1M rows)
  bench-compare, bench-update-baseline

Volume controls: BENCH_VOLUME (small/medium/max), BENCH_PIPE_ROWS,
BENCH_PIPE_ROWS_MAX, BENCH_DATA_DIR, BENCH_CSV.

Baseline + regression checking (P4)

  tests/bench/baseline.csv       51 rows: S1-S6 x {small,lmc,ooo}
                                 + L1-L14 + F1-F15 (11 of 15) +
                                 S7/S8 x {pipe100k, pipe1M}.
  compare_baseline.py            median over duplicate rows;
                                 exits 1 on any (scenario, volume)
                                 slowdown >= threshold (default 25%).

Verified at scale

  bench-pipeline-max: 1,000,000 rows, full content diff
    seed   17 s, export 304 s, import 31 s, idempotent re-import 10 s,
    diff 2.7 s -- mismatches=0.

Findings surfaced by the harness

  Export scales super-linearly: 4 s @ 100k -> 304 s @ 1M (76x for
    10x rows). Cause: g_slist_sort on the merged list + per-row
    ProfMessage/ff_parsed_line_t allocations. RSS peaks at 1.4 GB
    on 1M. Worth a follow-up.
  Export progress reporting only fires during the write phase --
    the merge+sort phase (~95% of wall time at 1M) is silent.
  /history export and /history import are blocking on the main
    UI thread; profanity is frozen for the duration (~5 min @ 1M).
  ff_readline sets *truncated=TRUE on partial-write tail but
    ff_verify_integrity does not surface this -- partial writes
    go unflagged (failure-injection F1).
  Parser silently truncates body at first unescaped ': ' if a
    resource was manually edited to contain it (F9).
  In gen_history (caught by the bench's own real-verify pass):
    g_strndup mid-codepoint truncation on UTF-8 bank strings -- fixed.

Linkage strategy

  database_flatfile.c + parser + verify + common.c are linked
  unconditionally. The export/import bench additionally links
  database.c + database_sqlite.c + database_export.c. bench_stubs.c
  provides minimal stubs for log_*, prefs_*, connection_get_jid,
  jid_create, files_*, message_*, ui hooks. integrity_issue_free
  is a weak symbol so it falls back to the real database.c
  implementation when that file is linked.
2026-04-30 15:39:30 +03:00
f8826b7c79 ci: improve CI stability with parallel builds and Valgrind
Major changes:
Run 4 build configurations in parallel with Valgrind on Linux
Add test failure detection verification (meta-test)
Port allocation per build to prevent conflicts in parallel runs
Add --coverage-only flag for dedicated coverage builds
Code quality:

Add TEST_GROUPS constant, CMOCKA patterns, helper functions
Organize ci-build.sh into sections
2026-02-02 17:47:05 +01:00
85c817ee8c ci: speed up builds 4x with parallel tests, coverage, and ccache
Split functional tests into 4 parallel groups and add check-functional-parallel target (~3x faster CI runs).
Add branch-aware LCOV coverage reporting with new --enable-coverage option and lcov summary in CI pipeline.
Enable ccache via -C configure flag for faster recompilations.
Install lcov in all Docker images and use --depth 1 git clones + parallel make -j$(nproc) for quicker container builds.
Update CONTRIBUTING.md with instructions for parallel test groups and adding new ones.

All changes are tightly related CI/performance improvements developed in sequence. No external service uploads (e.g. Codecov skipped due to Gitea incompatibility).
2026-01-21 16:35:17 +01:00
6a394ae2e5 fix: Increase scrollback buffer height for chat rendering (PAD_SIZE)
f27fa98 commit introduced issue of scrolling seemingly randomly being stuck and the following message flood in the logs: "WRN: Ncurses Overflow..."

A pad is an off-screen buffer — larger than the visible terminal screen — that you can scroll, render parts of, or update selectively.

Unlike regular windows, a pad is not tied to screen size. You can create a pad that's 1,000 lines tall, even if your terminal is only 40 lines tall.

This commit addresses the issue by increasing PAD_SIZE to a reasonable number,
allowing messages from buffer to be displayed without overflowing NCurses' window size (maxy).

Minor change: add .cache folder to gitignore
2025-07-01 16:42:03 +02:00
Michael Vetter
bf24d79990 Add plist to gitignore 2025-03-13 09:48:32 +01:00
Steffen Jaeckel
f67c76c032 Add make target my-prof.supp
This creates a "as personal as possible" Valgrind suppressions file.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-01-28 16:43:13 +01:00
Steffen Jaeckel
970cb706fb Minor changes
* slightly improve PR template
* update gitignore

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-10-04 17:02:10 +02:00
John Hernandez
bed5c02c0d Add vscode support to .gitignore 2023-04-18 14:28:30 +02:00
Steffen Jaeckel
e9aaba938b minor changes
* fix typo
* less code duplication
* less `GString` usage
* more `auto_gchar` usage
* document connecting to servers supporting SASL ANONYMOUS
* ignore valgrind output

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel
53a7689a58 update gitignore
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-30 18:26:10 +02:00
William Wennerström
62cbad1c6e Add I/O error handling and use filenames instead of file descriptors 2020-11-16 21:58:09 +01:00
Michael Vetter
7f956aa4f5 Add zipfiles to gitignore 2020-02-03 16:25:50 +01:00
Michael Vetter
d169312a84 Update gitignore 2020-01-30 11:55:05 +01:00
James Booth
7bc160c24e Update plugin API docs 2016-08-02 23:17:28 +01:00
James Booth
7314a13248 Update gitignore, added python API docs Makefile 2016-08-02 22:54:34 +01:00
James Booth
a308f5e4f1 Add python plugin hook docs 2016-07-29 00:27:26 +01:00
James Booth
1bc6941847 Update gitignore 2016-07-29 00:16:09 +01:00
James Booth
47dfa6c3fc Merge branch 'master' into python3
Conflicts:
	.gitignore
2016-07-24 01:22:29 +01:00
James Booth
458334a2c7 Update gitignore 2016-07-24 01:10:54 +01:00
James Booth
b68d2ce106 Update gitignore 2016-07-19 23:44:38 +01:00
James Booth
697db019d5 Merge remote-tracking branch 'Dav1d23/master'
Conflicts:
	Makefile.am
	install-all.sh
2016-04-11 00:23:36 +01:00
James Booth
9d782fa665 Added doxygen settings for C plugin API 2016-03-17 22:16:42 +00:00
James Booth
41fe8c22b1 Added C plugin code from plugins branch 2016-02-14 22:28:55 +00:00
James Booth
d944e8252e Updated .gitignore 2015-08-09 00:21:20 +01:00
James Booth
362c1d81ae Added codelite commands file to .gitignore 2015-06-13 00:34:36 +01:00
James Booth
68ed20f10d Moved all tests to tests folder 2015-06-12 23:53:30 +01:00
James Booth
c182f3ecd6 Added temp config files to gitignore 2015-06-12 23:05:30 +01:00
James Booth
b1375328df Tidied .gitignore 2015-06-12 22:46:52 +01:00
James Booth
e919445231 Renamed stabbertests -> functionaltests 2015-05-28 18:56:16 +01:00
James Booth
6d6bb64588 Moved tests -> unittests 2015-05-28 18:50:55 +01:00
James Booth
e295a474dc Added more connect tests 2015-05-24 20:31:18 +01:00
James Booth
97c5072f56 Added stabber testsuite 2015-05-17 01:11:03 +01:00
James Booth
5e1ad0b0d2 Added profanity.sh (OSX helper script for codelite) to .gitignore 2015-03-04 22:37:42 +00:00
James Booth
268c33e1c6 Free resource lists on /account command 2015-02-09 19:50:41 +00:00
James Booth
e0dfe4832b Added code to generate HTML command reference for website 2015-02-08 00:42:21 +00:00
James Booth
1e35b76bf9 Added callgrind.out files to gitignore 2015-02-06 21:41:24 +00:00
James Booth
e94b604b0c Updated gitignore 2015-01-14 13:26:54 +00:00
James Booth
f7843def2f Added chat session tests 2015-01-06 21:22:09 +00:00
James Booth
1814dcdd26 Added m4 directory to gitignore 2014-10-30 23:24:45 +00:00
James Booth
bca5a5f78d Merge branch 'master' into muc_roles
Conflicts:
	.gitignore
2014-09-30 20:46:26 +01:00
James Booth
fbeb107cbe Dont check for var attribute on form fields of type fixed 2014-09-30 20:44:00 +01:00
James Booth
2dacfc823a Updated gitignore 2014-09-29 00:00:11 +01:00
James Booth
ef34ddc1eb Updated gitignore 2014-09-28 23:32:06 +01:00
James Booth
51bb5f9e60 Added codelite project to gitignore 2014-09-28 23:04:16 +01:00
James Booth
62dd30ff90 Added push all script to .gitignore 2014-05-12 23:33:14 +01:00
James Booth
f44cf86f23 Added cppcheck.out to .gitignore 2014-04-26 00:42:54 +01:00
James Booth
ff18572ef0 Updated .gitignore 2014-04-06 23:51:34 +01:00
Dmitry Podgorny
0fbaa6f5ee fixed build error when make run with -jN option
Race can occur when gitversion file isn't fully generated before
it is used.
2014-03-06 02:06:22 +02:00
James Booth
185d72e2ce Added DS store to gitignore 2014-02-12 20:54:01 +00:00
James Booth
90d2cbff7b Removed manual logging of test results
Cmocka on more recent distros already has this functionality
2014-02-12 20:49:50 +00:00