@@ -30,48 +30,69 @@ whenOnEnv(
3030 values : jsonValues ,
3131 format : 'JSONEachRow' ,
3232 } )
33- expect ( insertSummary ) . toEqual ( {
34- read_rows : '5' ,
35- read_bytes : jasmine . any ( String ) ,
36- written_rows : '5' ,
37- written_bytes : jasmine . any ( String ) ,
38- total_rows_to_read : '0' ,
39- result_rows : '5' ,
40- result_bytes : jasmine . any ( String ) ,
41- elapsed_ns : jasmine . any ( String ) ,
42- } )
33+ expect ( insertSummary ) . toEqual (
34+ jasmine . objectContaining ( {
35+ read_rows : '5' ,
36+ read_bytes : jasmine . any ( String ) ,
37+ written_rows : '5' ,
38+ written_bytes : jasmine . any ( String ) ,
39+ total_rows_to_read : '0' ,
40+ result_rows : '5' ,
41+ result_bytes : jasmine . any ( String ) ,
42+ elapsed_ns : jasmine . any ( String ) ,
43+ } ) ,
44+ )
45+ assertRealTimeMicroseconds ( insertSummary )
4346
4447 const { summary : execSummary } = await client . exec ( {
45- query : `INSERT INTO ${ tableName } SELECT * FROM ${ tableName } ` ,
46- } )
47- expect ( execSummary ) . toEqual ( {
48- read_rows : '5' ,
49- read_bytes : jasmine . any ( String ) ,
50- written_rows : '5' ,
51- written_bytes : jasmine . any ( String ) ,
52- total_rows_to_read : '5' ,
53- result_rows : '5' ,
54- result_bytes : jasmine . any ( String ) ,
55- elapsed_ns : jasmine . any ( String ) ,
48+ query : `INSERT INTO ${ tableName }
49+ SELECT *
50+ FROM ${ tableName } ` ,
5651 } )
52+ expect ( execSummary ) . toEqual (
53+ jasmine . objectContaining ( {
54+ read_rows : '5' ,
55+ read_bytes : jasmine . any ( String ) ,
56+ written_rows : '5' ,
57+ written_bytes : jasmine . any ( String ) ,
58+ total_rows_to_read : '5' ,
59+ result_rows : '5' ,
60+ result_bytes : jasmine . any ( String ) ,
61+ elapsed_ns : jasmine . any ( String ) ,
62+ } ) ,
63+ )
64+ assertRealTimeMicroseconds ( execSummary )
5765 } )
5866
5967 it ( 'should provide summary for command' , async ( ) => {
6068 const { summary } = await client . command ( {
61- query : `INSERT INTO ${ tableName } VALUES (144, 'Hello', [2, 4]), (255, 'World', [3, 5])` ,
69+ query : `INSERT INTO ${ tableName }
70+ VALUES (144, 'Hello', [2, 4]),
71+ (255, 'World', [3, 5])` ,
6272 clickhouse_settings : {
6373 wait_end_of_query : 1 ,
6474 } ,
6575 } )
66- expect ( summary ) . toEqual ( {
67- read_rows : '2' ,
68- read_bytes : jasmine . any ( String ) ,
69- written_rows : '2' ,
70- written_bytes : jasmine . any ( String ) ,
71- total_rows_to_read : '0' ,
72- result_rows : '2' ,
73- result_bytes : jasmine . any ( String ) ,
74- elapsed_ns : jasmine . any ( String ) ,
75- } )
76+ expect ( summary ) . toEqual (
77+ jasmine . objectContaining ( {
78+ read_rows : '2' ,
79+ read_bytes : jasmine . any ( String ) ,
80+ written_rows : '2' ,
81+ written_bytes : jasmine . any ( String ) ,
82+ total_rows_to_read : '0' ,
83+ result_rows : '2' ,
84+ result_bytes : jasmine . any ( String ) ,
85+ elapsed_ns : jasmine . any ( String ) ,
86+ } ) ,
87+ )
88+ assertRealTimeMicroseconds ( summary )
7689 } )
90+
91+ function assertRealTimeMicroseconds ( summary : any ) {
92+ // FIXME: remove this condition after 24.9 is released
93+ if ( process . env [ 'CLICKHOUSE_VERSION' ] === 'head' ) {
94+ expect ( summary . real_time_microseconds ) . toBeDefined ( )
95+ expect ( summary . real_time_microseconds ) . toMatch ( / ^ \d + $ / )
96+ }
97+ }
7798} )
0 commit comments