Skip to content

Commit 42cf49a

Browse files
committed
Probe: isolate testTemporaryTableHasPriority with querying-only filter
The shared SQL-capture probe trace gets dominated by translate_expr DEBUG noise from the test's setUp (information_schema scaffolding), so the actual ALTER TABLE never reaches the head -2500 cap. Add a dedicated probe step that runs only this test and grep-filters the trace down to 'querying' lines plus errors. 800-line cap is plenty once the noise is gone. (Hash-join correlated fix landed earlier confirmed 591/596 in run 24938474109.)
1 parent 98ee736 commit 42cf49a

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/phpunit-tests-turso.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,65 @@ jobs:
21842184
PHP
21852185
echo "(probe step: continue-on-error)"
21862186
2187+
- name: Probe — testTemporaryTableHasPriority isolated, querying-only filter
2188+
continue-on-error: true
2189+
env:
2190+
LD_PRELOAD: ${{ steps.preload.outputs.value }}
2191+
# translate=trace gives us "querying <SQL>" lines plus a lot of DEBUG
2192+
# translate_expr noise. We grep down to just the SQL + errors so the
2193+
# whole test trace fits in the log even with many statements.
2194+
RUST_LOG: 'turso_core::translate=trace,turso_core::storage=warn'
2195+
working-directory: packages/mysql-on-sqlite
2196+
run: |
2197+
set +e
2198+
timeout --kill-after=5 60 \
2199+
php <<'PHP' 2>&1 \
2200+
| grep -E '(querying |ERROR|WARN|=== | -> |short read|page is pinned|page [0-9]+ is)' \
2201+
| head -800
2202+
<?php
2203+
// Same scenario as the SQL-capture probe, but isolated to the failing
2204+
// test so its trace doesn't get flushed by the upstream truncation.
2205+
require __DIR__ . '/vendor/autoload.php';
2206+
require __DIR__ . '/tests/bootstrap.php';
2207+
2208+
$pdo_class = PHP_VERSION_ID >= 80400 ? PDO\SQLite::class : PDO::class;
2209+
$sqlite = new $pdo_class('sqlite::memory:');
2210+
$conn = new WP_SQLite_Connection(['pdo' => $sqlite]);
2211+
$engine = new WP_SQLite_Driver($conn, 'wp');
2212+
2213+
$statements = [
2214+
"CREATE TABLE _options (
2215+
ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
2216+
option_name TEXT NOT NULL default '',
2217+
option_value TEXT NOT NULL default ''
2218+
)",
2219+
"CREATE TABLE _dates (
2220+
ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
2221+
option_name TEXT NOT NULL default '',
2222+
option_value DATETIME NOT NULL
2223+
)",
2224+
'CREATE TABLE t (a INT, INDEX ia(a))',
2225+
'CREATE TEMPORARY TABLE t (b INT, INDEX ib(b))',
2226+
'SHOW CREATE TABLE t',
2227+
'SHOW COLUMNS FROM t',
2228+
'DESCRIBE t',
2229+
'SHOW INDEXES FROM t',
2230+
'ALTER TABLE t ADD COLUMN c INT',
2231+
'SHOW COLUMNS FROM t',
2232+
];
2233+
foreach ($statements as $sql) {
2234+
$first = strtok($sql, "\n");
2235+
fwrite(STDERR, "\n=== STMT: $first ===\n");
2236+
try {
2237+
$engine->query($sql);
2238+
fwrite(STDERR, " -> ok\n");
2239+
} catch (Throwable $e) {
2240+
fwrite(STDERR, "=== FAIL $first -> " . $e->getMessage() . " ===\n");
2241+
}
2242+
}
2243+
PHP
2244+
echo "(probe step: continue-on-error)"
2245+
21872246
- name: Run PHPUnit tests against Turso DB
21882247
env:
21892248
LD_PRELOAD: ${{ steps.preload.outputs.value }}

0 commit comments

Comments
 (0)