Skip to content

Added test framework for testing wire data#2346

Merged
Hydrocharged merged 1 commit intomainfrom
daylon/wire-tests
Feb 18, 2026
Merged

Added test framework for testing wire data#2346
Hydrocharged merged 1 commit intomainfrom
daylon/wire-tests

Conversation

@Hydrocharged
Copy link
Collaborator

This is a precursor for:

Currently, we have no in-engine way of ensuring that the proper data is received on the wire for any given sequence of messages that were sent. This means that we must rely on client tests to ensure that the correct data is sent, with the expectation that they'll fail if we change something. This isn't conducive to our standard debugging workflow, so this adds the ability to perform wire tests and verification from within the Go testing environment, which is resistant to change (client tests could fail due to a library update that is outside of our control) and easily debuggable.

For most of these tests, I'll be using WireShark to ensure that our output is exactly the same as a standard Postgres server.

@Hydrocharged Hydrocharged requested a review from fulghum February 18, 2026 12:29
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Main PR
covering_index_scan_postgres 548.87/s 544.00/s -0.9%
index_join_postgres 118.86/s 118.91/s 0.0%
index_join_scan_postgres 174.51/s 174.41/s -0.1%
index_scan_postgres 11.13/s 11.06/s -0.7%
oltp_point_select 2264.58/s 2285.43/s +0.9%
oltp_read_only 1669.09/s 1671.39/s +0.1%
select_random_points 104.75/s 107.74/s +2.8%
select_random_ranges 419.48/s 419.28/s -0.1%
table_scan_postgres 10.84/s 10.79/s -0.5%
types_table_scan_postgres 4.95/s 4.95/s 0.0%

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Main PR
Total 42090 42090
Successful 17520 17571
Failures 24570 24519
Partial Successes1 5575 5585
Main PR
Successful 41.6251% 41.7463%
Failures 58.3749% 58.2537%

${\color{lightgreen}Progressions (52)}$

rowtypes

QUERY: create temp table quadtable(f1 int, q quad);
QUERY: create temp table people (fn fullname, bd date);
QUERY: create temp table pp (f1 text);
QUERY: insert into pp values (repeat('abcdefghijkl', 100000));
QUERY: select ROW(1,2) < ROW(1,3) as true;
QUERY: select ROW(1,2) < ROW(1,NULL) as null;
QUERY: select ROW(1,2,3) < ROW(1,3,NULL) as true;
QUERY: select ROW(11,'ABC') < ROW(11,'DEF') as true;
QUERY: select ROW(12,'ABC') > ROW(11,'DEF') as true;
QUERY: select ROW(1,2,3) < ROW(1,NULL,4) as null;
QUERY: select ROW(1,2,3) <> ROW(1,NULL,4) as true;
QUERY: select ROW(1,2) = ROW(1,2::int8);
QUERY: select ROW(1,2) in (ROW(3,4), ROW(1,2));
QUERY: select ROW(1,2) in (ROW(3,4), ROW(1,2::int8));
QUERY: select thousand, tenthous from tenk1
where (thousand, tenthous) >= (997, 5000)
order by thousand, tenthous;
QUERY: create temp table test_table (a text, b text);
QUERY: insert into test_table values ('a', 'b');
QUERY: insert into test_table select 'a', null from generate_series(1,1000);
QUERY: insert into test_table values ('b', 'a');
QUERY: create index on test_table (a,b);
QUERY: set enable_sort = off;
QUERY: select a,b from test_table where (a,b) > ('a','a') order by a,b;
QUERY: reset enable_sort;
QUERY: select ROW();
QUERY: select ROW() IS NULL;
QUERY: select array[ row(1,2), row(3,4), row(5,6) ];
QUERY: select row(1,1.1) = any (array[ row(7,7.7), row(1,1.1), row(0,0.0) ]);
QUERY: select row(1,1.1) = any (array[ row(7,7.7), row(1,1.0), row(0,0.0) ]);
QUERY: create type testtype1 as (a int, b int);
QUERY: create type testtype3 as (a int, b text);
QUERY: create type testtype5 as (a int);
QUERY: create type testtype2 as (a smallint, b bool);
QUERY: CREATE TABLE price (
    id SERIAL PRIMARY KEY,
    active BOOLEAN NOT NULL,
    price NUMERIC
);
QUERY: CREATE TYPE price_input AS (
    id INTEGER,
    price NUMERIC
);
QUERY: CREATE TYPE price_key AS (
    id INTEGER
);
QUERY: insert into price values (1,false,42), (10,false,100), (11,true,17.99);
QUERY: rollback;
QUERY: create temp table compos (f1 int, f2 text);
QUERY: select cast (fullname as text) from fullname;
QUERY: select fullname::text from fullname;

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Hydrocharged Hydrocharged merged commit b040612 into main Feb 18, 2026
17 checks passed
@Hydrocharged Hydrocharged deleted the daylon/wire-tests branch February 18, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments