Problem
All database unit tests (50 tests) fail when run from the build directory but pass when run from /tmp.
Error Observed
Can't open database: unable to open database file
From ../../../src/core/database.cpp:538
bool Database::CreateNewDatabase(wxFileName)
Observations
- From build dir:
./build/clang-gpu-debug-static/src/unit_test_runner → FAILS
- From /tmp:
cd /tmp && /path/to/unit_test_runner "[database]" → PASSES (1336 assertions, 49 tests)
- Build directory should be writable, so permissions unlikely the issue
Current Hypothesis
Issue may be related to:
- Path construction in test helpers or Database class
- CWD assumptions in temporary file creation
- Relative vs absolute path handling
wxFileName::CreateTempFileName() behavior from different directories
Expected Behavior
wxFileName::CreateTempFileName() should use /tmp regardless of CWD, so tests should work from any directory.
Temporary Workaround
Tests are tagged [.broken] to exclude from CI until root cause is identified and fixed.
Files Affected
All test files in src/test/core/database/:
- database_batch_ops.cpp (9 tests)
- database_insert.cpp (5 tests)
- database_lifecycle.cpp (11 tests)
- database_queries.cpp (8 tests)
- database_tables.cpp (9 tests)
- database_transactions.cpp (7 tests)
- batch_debug.cpp (1 test)
Total: 50 tests tagged with [.broken]
Investigation Needed
- Debug why
wxFileName::CreateTempFileName() fails from build directory
- Add directory writability assertions to test setup
- Fix root cause so tests work from any directory
- Remove
[.broken] tags once fixed
Related
Problem
All database unit tests (50 tests) fail when run from the build directory but pass when run from
/tmp.Error Observed
Observations
./build/clang-gpu-debug-static/src/unit_test_runner→ FAILScd /tmp && /path/to/unit_test_runner "[database]"→ PASSES (1336 assertions, 49 tests)Current Hypothesis
Issue may be related to:
wxFileName::CreateTempFileName()behavior from different directoriesExpected Behavior
wxFileName::CreateTempFileName()should use/tmpregardless of CWD, so tests should work from any directory.Temporary Workaround
Tests are tagged
[.broken]to exclude from CI until root cause is identified and fixed.Files Affected
All test files in
src/test/core/database/:Total: 50 tests tagged with
[.broken]Investigation Needed
wxFileName::CreateTempFileName()fails from build directory[.broken]tags once fixedRelated