diff --git a/src/test/regress/expected/select_parallel.out b/src/test/regress/expected/select_parallel.out
index b51c20c449d7e273aa0acd7660605ed6be85ba4b..58ab425add8a3202143119058b50efe5e955de3f 100644
--- a/src/test/regress/expected/select_parallel.out
+++ b/src/test/regress/expected/select_parallel.out
@@ -1,14 +1,8 @@
 --
 -- PARALLEL
 --
-create or replace function parallel_restricted(int) returns int as $$
-begin
-  perform * from pg_stat_activity where client_port is null;
-  if (found) then
-    raise 'parallel restricted function run in worker';
-  end if;
-  return $1;
-end$$ language plpgsql parallel restricted;
+create or replace function parallel_restricted(int) returns int as
+  $$begin return $1; end$$ language plpgsql parallel restricted;
 -- Serializable isolation would disable parallel query, so explicitly use an
 -- arbitrary other level.
 begin isolation level repeatable read;
@@ -57,27 +51,6 @@ select parallel_restricted(unique1) from tenk1
                Filter: (tenk1.stringu1 = 'GRAAAA'::name)
 (9 rows)
 
-select parallel_restricted(unique1) from tenk1
-  where stringu1 = 'GRAAAA' order by 1;
- parallel_restricted 
----------------------
-                 448
-                1124
-                1800
-                2476
-                3152
-                3828
-                4504
-                5180
-                5856
-                6532
-                7208
-                7884
-                8560
-                9236
-                9912
-(15 rows)
-
 set force_parallel_mode=1;
 explain (costs off)
   select stringu1::int2 from tenk1 where unique1 = 1;
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql
index 22dfb184c8eb4edbb1e2af18ce6348b119f19d88..bb02ee0019fd75faf5d379e7778f0ad6dcaa999b 100644
--- a/src/test/regress/sql/select_parallel.sql
+++ b/src/test/regress/sql/select_parallel.sql
@@ -2,14 +2,8 @@
 -- PARALLEL
 --
 
-create or replace function parallel_restricted(int) returns int as $$
-begin
-  perform * from pg_stat_activity where client_port is null;
-  if (found) then
-    raise 'parallel restricted function run in worker';
-  end if;
-  return $1;
-end$$ language plpgsql parallel restricted;
+create or replace function parallel_restricted(int) returns int as
+  $$begin return $1; end$$ language plpgsql parallel restricted;
 
 -- Serializable isolation would disable parallel query, so explicitly use an
 -- arbitrary other level.
@@ -29,8 +23,6 @@ alter table tenk1 set (parallel_workers = 4);
 explain (verbose, costs off)
 select parallel_restricted(unique1) from tenk1
   where stringu1 = 'GRAAAA' order by 1;
-select parallel_restricted(unique1) from tenk1
-  where stringu1 = 'GRAAAA' order by 1;
 
 set force_parallel_mode=1;