2
2
#
3
3
# SUMMARY
4
4
#
5
- # Waits until the passed number ($count_sessions) of concurrent sessions was
6
- # observed via
5
+ # Waits until the passed number ($count_sessions) of concurrent sessions or
6
+ # a smaller number was observed via
7
7
# SHOW STATUS LIKE 'Threads_connected'
8
8
# or the operation times out.
9
- # Note: Starting with 5.1 we could also use
10
- # SELECT COUNT(*) FROM information_schema.processlist
11
- # I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
12
- # runs in all versions 5.0+
9
+ # Note:
10
+ # 1. We wait for $current_sessions <= $count_sessions because in the use case
11
+ # with count_sessions.inc before and wait_until_count_sessions.inc after
12
+ # the core of the test it could happen that the disconnects of sessions
13
+ # belonging to the preceeding test are not finished.
14
+ # sessions at test begin($count_sessions) = m + n
15
+ # sessions of the previous test which will be soon disconnected = n (n >= 0)
16
+ # sessions at test end ($current sessions, assuming the test disconnects
17
+ # all additional sessions) = m
18
+ # 2. Starting with 5.1 we could also use
19
+ # SELECT COUNT(*) FROM information_schema.processlist
20
+ # I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
21
+ # runs in all versions 5.0+
13
22
#
14
23
#
15
24
# USAGE
19
28
#
20
29
# OR typical example of a test which uses more than one session
21
30
# Such a test could harm successing tests if there is no server shutdown
22
- # and start between.cw
31
+ # and start between.
23
32
#
24
33
# If the testing box is slow than the disconnect of sessions belonging to
25
34
# the current test might happen when the successing test gets executed.
79
88
# backup.test, grant3.test
80
89
#
81
90
#
82
- # Created: 2009-01-14 mleich
91
+ # Created:
92
+ # 2009-01-14 mleich
93
+ # Modified:
94
+ # 2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
95
+ # random PB failures
83
96
#
84
97
85
98
let $wait_counter = 100 ;
@@ -93,7 +106,7 @@ let $wait_timeout= 0;
93
106
while ($wait_counter )
94
107
{
95
108
let $current_sessions = query_get_value (SHOW STATUS LIKE 'Threads_connected' , Value , 1 );
96
- let $success = `SELECT $current_sessions = $count_sessions `;
109
+ let $success = `SELECT $current_sessions < = $count_sessions `;
97
110
if ($success )
98
111
{
99
112
let $wait_counter = 0 ;
@@ -107,7 +120,7 @@ while ($wait_counter)
107
120
if (!$success )
108
121
{
109
122
--echo # Timeout in wait_until_count_sessions.inc
110
- --echo # Number of sessions expected: $count_sessions found: $current_sessions
123
+ --echo # Number of sessions expected: < $count_sessions found: $current_sessions
111
124
SHOW PROCESSLIST ;
112
125
}
113
126
0 commit comments