summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc
blob: a2ed41d9d1b47bc01c0761c413f5309e26b6e9cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Tests for the performance schema
# This helper can be used to enforce that no threads from previous
# tests are still running, which can impact some test scripts.

# Wait until there is only one session left, this one.

let $wait_condition=
  select count(*) = 1 from information_schema.processlist;
--source include/wait_condition.inc

# Threads are removed from information_schema.processlist
# very soon, but continue to execute in the server,
# before finally be removed from performance_schema.threads.
# Because instrumentation is optional, we use "<=" here.

let $wait_condition=
  select count(*) <= 1 from performance_schema.threads
  where `TYPE`='FOREGROUND';
--source include/wait_condition.inc