File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/Sys Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,16 @@ public class AdoNetQuerySessionTests : TestBase
77 [ Fact ]
88 public async Task QuerySessionPidTest ( )
99 {
10+ var expectedPid = Environment . ProcessId . ToString ( ) ;
11+
1012 await using var connection = await CreateOpenConnectionAsync ( ) ;
1113 var dbCommand = connection . CreateCommand ( ) ;
12- dbCommand . CommandText = "SELECT ClientPID FROM `.sys/query_sessions` LIMIT 1;" ;
13-
14- var expectedPid = Environment . ProcessId . ToString ( ) ;
14+ dbCommand . CommandText = "SELECT ClientPID FROM `.sys/query_sessions` WHERE ClientPID = @pid;" ;
15+ dbCommand . Parameters . Add ( new YdbParameter ( "pid" , expectedPid ) ) ;
1516
1617 await dbCommand . ExecuteNonQueryAsync ( ) ;
17- await using var reader = await dbCommand . ExecuteReaderAsync ( ) ;
18+ var actualPid = await dbCommand . ExecuteScalarAsync ( ) ;
1819
19- Assert . True ( reader . HasRows ) ;
20- Assert . True ( await reader . ReadAsync ( ) ) ;
21- Assert . Equal ( reader . GetString ( 0 ) , expectedPid ) ;
20+ Assert . Equal ( expectedPid , actualPid ) ;
2221 }
2322}
You can’t perform that action at this time.
0 commit comments