Skip to content

Commit 656f12e

Browse files
committed
Revert temp_store=MEMORY patch — it also crashes testReconstructTable
Even scoping `PRAGMA temp_store = MEMORY` to only the two failing temp-table test methods (so the patched PRAGMA runs in *those tests'* PDO connections) caused testReconstructTable to dump core ~5s after it started in a subsequent test class. The temp_store change must mutate process-global Turso state that testReconstructTable's pager later depends on (memory: project_turso_testreconstructtable_fragile). Drop the patch and leave the two temp-table tests as failing. Update the workflow comment so future attempts know not to retry this lever. Net: still at 589/596 with the same 3 failures.
1 parent fcb7399 commit 656f12e

1 file changed

Lines changed: 9 additions & 37 deletions

File tree

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

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,43 +1896,15 @@ jobs:
18961896
open(path, 'w').write(src)
18971897
print('patched testCreateTableWithDefaultExpressions PRAGMA expectations for Turso')
18981898
1899-
# 20. testCreateTemporaryTable / testTemporaryTableHasPriorityOverStandardTable
1900-
# fail mid-suite under Turso with `I/O error: short read on
1901-
# page N` from the pager. With the default temp_store
1902-
# setting Turso creates a per-connection temp database on
1903-
# disk (via `tempfile::tempdir()` in core/connection.rs).
1904-
# The CI probe of the same SQL on a fresh PDO passes, so
1905-
# the bug is state-dependent — likely accumulated test state
1906-
# interacts with the disk temp pager.
1907-
#
1908-
# Setting `PRAGMA temp_store = MEMORY` at connection setup
1909-
# fixes these tests but crashes testReconstructTable in
1910-
# Turso's pager (it's hypersensitive to small Turso state
1911-
# changes — see project_turso_testreconstructtable_fragile).
1912-
# Instead, opt into `temp_store = MEMORY` only at the start
1913-
# of the two failing tests so testReconstructTable is
1914-
# unaffected.
1915-
path = 'tests/WP_SQLite_Driver_Tests.php'
1916-
src = open(path).read()
1917-
inject_at = "\tpublic function testCreateTemporaryTable() {\n"
1918-
inject = (
1919-
"\tpublic function testCreateTemporaryTable() {\n"
1920-
"\t\t// Force in-memory temp store: Turso's default disk temp pager has\n"
1921-
"\t\t// a state-dependent `short read on page N` bug that surfaces here.\n"
1922-
"\t\t$this->engine->get_connection()->query( 'PRAGMA temp_store = MEMORY' );\n"
1923-
)
1924-
assert inject_at in src and src.count(inject_at) == 1, 'testCreateTemporaryTable opener not found uniquely'
1925-
src = src.replace(inject_at, inject, 1)
1926-
inject_at_2 = "\tpublic function testTemporaryTableHasPriorityOverStandardTable(): void {\n"
1927-
inject_2 = (
1928-
"\tpublic function testTemporaryTableHasPriorityOverStandardTable(): void {\n"
1929-
"\t\t// Same Turso temp-pager workaround as testCreateTemporaryTable.\n"
1930-
"\t\t$this->engine->get_connection()->query( 'PRAGMA temp_store = MEMORY' );\n"
1931-
)
1932-
assert inject_at_2 in src and src.count(inject_at_2) == 1, 'testTemporaryTableHasPriorityOverStandardTable opener not found uniquely'
1933-
src = src.replace(inject_at_2, inject_2, 1)
1934-
open(path, 'w').write(src)
1935-
print('patched testCreateTemporaryTable + testTemporaryTableHasPriorityOverStandardTable to set PRAGMA temp_store = MEMORY')
1899+
# 20. NOTE: setting PRAGMA temp_store = MEMORY (either globally
1900+
# at connection setup or scoped to the two failing temp
1901+
# tests) consistently crashes testReconstructTable in
1902+
# Turso's pager — the temp_store change must mutate some
1903+
# process-global Turso state that testReconstructTable
1904+
# depends on (memory: project_turso_testreconstructtable_fragile).
1905+
# The two temp-table tests stay failing under Turso. No
1906+
# driver-side workaround found that doesn't break a
1907+
# currently-passing test.
19361908
PY
19371909
19381910
- name: Run PHPUnit tests against Turso DB

0 commit comments

Comments
 (0)