Skip to content

Commit f311f8d

Browse files
committed
Debug tests
1 parent 9b032ae commit f311f8d

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.github/workflows/debugging-tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: macos-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
9+
- name: Set up PHP
10+
uses: shivammathur/setup-php@v2
11+
with:
12+
php-version: '8.0'
13+
tools: phpunit-polyfills
14+
extensions: zip, sqlite3, pdo, pdo_sqlite
15+
16+
- name: Install Composer dependencies (using composer-ci-matrix-tests.json)
17+
run: |
18+
rm composer.lock
19+
cp composer-ci-matrix-tests.json composer.json
20+
composer install --no-interaction --no-progress --optimize-autoloader
21+
22+
- name: Setup tmate session
23+
uses: mxschmitt/action-tmate@v3

components/ByteStream/ReadStream/BaseByteReadStream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ protected function pull_exactly( $n ): int {
7575
}
7676

7777
if ( $empty_pulls > 4 ) {
78+
var_dump( '4 empty pulls in a row, we are probably at the end of the data' );
7879
throw new NotEnoughDataException( '4 empty pulls in a row, we are probably at the end of the data' );
7980
}
8081
}

components/HttpClient/ByteStream/RequestReadStream.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ private function pull_until_event( $options = array() ) {
161161
}
162162
break;
163163
case Client::EVENT_FINISHED:
164+
var_dump( 'finished', $this->remote_file_length );
164165
/**
165166
* If the server did not provide a Content-Length header,
166167
* backfill the file length with the number of downloaded
@@ -169,6 +170,7 @@ private function pull_until_event( $options = array() ) {
169170
if ( null === $this->remote_file_length ) {
170171
$this->remote_file_length = $this->bytes_already_forgotten + strlen( $this->buffer );
171172
}
173+
var_dump( 'after finished', $this->remote_file_length );
172174

173175
return '';
174176
case Client::EVENT_FAILED:

components/HttpClient/ByteStream/SeekableRequestReadStream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public function consume_all(): string {
106106
while ( ! $this->remote->reached_end_of_data() ) {
107107
$pulled = $this->remote->pull( BaseByteReadStream::CHUNK_SIZE );
108108
if ( 0 === $pulled ) {
109+
var_dump( 'pulled 0' );
109110
break;
110111
}
111112
$this->cache->append_bytes( $this->remote->consume( $pulled ) );

0 commit comments

Comments
 (0)