Skip to content

Commit cd415ba

Browse files
authored
Merge pull request #27 from true-async/25-fix-the-degradation-of-phps-general-tests
25 fix the degradation of phps general tests
2 parents a6ca563 + b6d70d9 commit cd415ba

File tree

3 files changed

+59
-4
lines changed

3 files changed

+59
-4
lines changed

.github/workflows/build-cross-platform.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
--with-config-file-path=/etc \
136136
--with-config-file-scan-dir=/etc/php.d \
137137
--with-pdo-firebird \
138+
--enable-address-sanitizer \
138139
--enable-async
139140
140141
- name: Build PHP
@@ -165,7 +166,7 @@ jobs:
165166
--no-progress \
166167
--offline \
167168
--show-diff \
168-
--show-slow 2000 \
169+
--show-slow 4000 \
169170
--set-timeout 120 \
170171
--repeat 2
171172
@@ -309,6 +310,7 @@ jobs:
309310
--enable-inifile \
310311
--with-config-file-path=/usr/local/etc \
311312
--with-config-file-scan-dir=/usr/local/etc/php.d \
313+
--enable-address-sanitizer \
312314
--enable-async
313315
314316
- name: Build PHP (macOS)
@@ -342,7 +344,7 @@ jobs:
342344
--no-progress ^
343345
--offline ^
344346
--show-diff ^
345-
--show-slow 2000 ^
347+
--show-slow 4000 ^
346348
--set-timeout 120 ^
347349
--repeat 2
348350
shell: cmd
@@ -364,6 +366,6 @@ jobs:
364366
--no-progress \
365367
--offline \
366368
--show-diff \
367-
--show-slow 2000 \
369+
--show-slow 4000 \
368370
--set-timeout 120 \
369371
--repeat 2

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ jobs:
134134
--with-config-file-path=/etc \
135135
--with-config-file-scan-dir=/etc/php.d \
136136
--with-pdo-firebird \
137+
--enable-address-sanitizer \
137138
--enable-async
138139
139140
- name: Build PHP
@@ -164,6 +165,6 @@ jobs:
164165
--no-progress \
165166
--offline \
166167
--show-diff \
167-
--show-slow 2000 \
168+
--show-slow 4000 \
168169
--set-timeout 120 \
169170
--repeat 2
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--TEST--
2+
Fibers in destructors 006: multiple GC runs
3+
--FILE--
4+
<?php
5+
6+
register_shutdown_function(function () {
7+
printf("Shutdown\n");
8+
});
9+
10+
class Cycle {
11+
public static $counter = 0;
12+
public $self;
13+
public function __construct() {
14+
$this->self = $this;
15+
}
16+
public function __destruct() {
17+
$id = self::$counter++;
18+
printf("%d: Start destruct\n", $id);
19+
if ($id === 0) {
20+
global $f2;
21+
$f2 = Fiber::getCurrent();
22+
Fiber::suspend(new stdClass);
23+
}
24+
printf("%d: End destruct\n", $id);
25+
}
26+
}
27+
28+
$f = new Fiber(function () {
29+
new Cycle();
30+
new Cycle();
31+
gc_collect_cycles();
32+
});
33+
34+
$f->start();
35+
36+
new Cycle();
37+
new Cycle();
38+
gc_collect_cycles();
39+
40+
$f2->resume();
41+
42+
?>
43+
--EXPECT--
44+
0: Start destruct
45+
1: Start destruct
46+
1: End destruct
47+
2: Start destruct
48+
2: End destruct
49+
3: Start destruct
50+
3: End destruct
51+
0: End destruct
52+
Shutdown

0 commit comments

Comments
 (0)