Skip to content

Commit 10f2378

Browse files
committedFeb 10, 2023
Fix concurrent testing
1 parent f169440 commit 10f2378

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed
 

‎ext/zend_test/tests/gh10370_1.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ zend_test.limit_copy_file_range=3584
1616
/* Note: the value 3584 is chosen so that the mmap in _php_stream_copy_to_stream_ex() will mmap
1717
* at an offset of a multiple of 4096, which is the standard page size in most Linux systems. */
1818
$archive = new PharData(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar');
19-
var_dump($archive->extractTo(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370', ['testfile']));
20-
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370' . DIRECTORY_SEPARATOR . 'testfile'));
19+
var_dump($archive->extractTo(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_001', ['testfile']));
20+
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_001' . DIRECTORY_SEPARATOR . 'testfile'));
2121
?>
2222
--EXPECT--
2323
bool(true)
2424
string(40) "a723ae4ec7eababff73ca961a771b794be6388d2"
2525
--CLEAN--
2626
<?php
27-
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370' . DIRECTORY_SEPARATOR . 'testfile');
28-
@rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370');
27+
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_001' . DIRECTORY_SEPARATOR . 'testfile');
28+
@rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_001');
2929
?>

‎ext/zend_test/tests/gh10370_2.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ zend_test.limit_copy_file_range=4096
1515
/* Note: the value 4096 is chosen so that the mmap in _php_stream_copy_to_stream_ex() will mmap
1616
* at an offset of a multiple of 4096, which is the standard page size in most Linux systems. */
1717
$input_file = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar', 'r');
18-
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar', $input_file);
18+
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_002_out.tar', $input_file);
1919
fclose($input_file);
2020

2121
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar'));
22-
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar'));
22+
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_002_out.tar'));
2323
?>
2424
--EXPECT--
2525
string(40) "edcad8cd6c276f5e318c826ad77a5604d6a6e93d"
2626
string(40) "edcad8cd6c276f5e318c826ad77a5604d6a6e93d"
2727
--CLEAN--
2828
<?php
29-
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar');
29+
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_002_out.tar');
3030
?>

‎ext/zend_test/tests/gh10370_3.phpt

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ zend_test.limit_copy_file_range=3584
1414
<?php
1515
/* Note: the value 3584 is chosen so that the mmap in _php_stream_copy_to_stream_ex() will mmap
1616
* at an offset of a multiple of 4096, which is the standard page size in most Linux systems. */
17-
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370');
17+
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_003');
1818

1919
$input = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar', 'r');
20-
$output = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370' . DIRECTORY_SEPARATOR . 'testfile', 'w');
20+
$output = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_003' . DIRECTORY_SEPARATOR . 'testfile', 'w');
2121

2222
var_dump(stream_copy_to_stream($input, $output, 10240, 0x200));
2323

2424
fclose($input);
2525
fclose($output);
2626

27-
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370' . DIRECTORY_SEPARATOR . 'testfile'));
27+
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_003' . DIRECTORY_SEPARATOR . 'testfile'));
2828
?>
2929
--EXPECT--
3030
int(10240)
3131
string(40) "a723ae4ec7eababff73ca961a771b794be6388d2"
3232
--CLEAN--
3333
<?php
34-
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370' . DIRECTORY_SEPARATOR . 'testfile');
35-
@rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370');
34+
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_003' . DIRECTORY_SEPARATOR . 'testfile');
35+
@rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_003');
3636
?>

‎ext/zend_test/tests/gh10370_4.phpt

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,22 @@ zend_test.limit_copy_file_range=4096
1515
/* Note: the value 4096 is chosen so that the mmap in _php_stream_copy_to_stream_ex() will mmap
1616
* at an offset of a multiple of 4096, which is the standard page size in most Linux systems. */
1717

18-
mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370');
19-
2018
$input = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar', 'r');
21-
$output = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar', 'w');
19+
$output = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_004_out.tar', 'w');
2220

2321
var_dump(stream_copy_to_stream($input, $output));
2422

2523
fclose($input);
2624
fclose($output);
2725

2826
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370.tar'));
29-
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar'));
27+
var_dump(sha1_file(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_004_out.tar'));
3028
?>
3129
--EXPECT--
3230
int(11776)
3331
string(40) "edcad8cd6c276f5e318c826ad77a5604d6a6e93d"
3432
string(40) "edcad8cd6c276f5e318c826ad77a5604d6a6e93d"
3533
--CLEAN--
3634
<?php
37-
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_out.tar');
35+
@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'gh10370_004_out.tar');
3836
?>

0 commit comments

Comments
 (0)