Clean up test infrastructure and fix test assertions

- Replace test.skip() with proper expect() assertions when app fails to load
- Remove button-finder utility (no longer needed with element registry)
- Remove kicad tests (tested separately)
- Add findByName/clickByName helpers for bitmap buttons
- Fix element lookups: use clickByName for bitmap buttons, clickTreeItem
  for treebook pages, selectComboItem for wxChoice items
- Add SetName() to shape buttons in bitmapbuttons_test.cpp
- Remove verbose logging from print and threadpool tests
- Update README to reflect current test infrastructure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-01-01 20:18:19 +01:00
commit 251056e506
42 changed files with 241 additions and 1138 deletions

View file

@ -19,32 +19,13 @@ test.describe('Thread Pool Deadlock Tests', () => {
await page.screenshot({ path: 'test-results/threadpool-01-loaded.png', fullPage: true });
// Check console for hardware_concurrency value
const hardwareConcurrencyLog = testLogger.consoleLogs.find(log =>
log.includes('[THREADPOOL] hardware_concurrency:')
);
if (hardwareConcurrencyLog) {
console.log('Detected:', hardwareConcurrencyLog);
}
// Check for success marker - all threads created and joined
const success = testLogger.consoleLogs.some(log =>
log.includes('[THREADPOOL] SUCCESS')
);
// Check for blocking warning (indicates potential deadlock situation)
const blockingWarning = testLogger.consoleLogs.some(log =>
log.includes('Blocking on the main thread is very dangerous')
);
expect(loaded, 'App should load without deadlock').toBe(true);
expect(success, 'All threads should complete successfully').toBe(true);
// Log blocking warning status (informational, doesn't fail test)
if (blockingWarning) {
console.log('Warning: Blocking on main thread detected (thread creation may have triggered worker spawn)');
}
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
});
@ -52,37 +33,24 @@ test.describe('Thread Pool Deadlock Tests', () => {
await page.goto('/standalone/threadpool/threadpool_test.html');
const loaded = await tryLoadApp(page, 30000);
if (!loaded) {
test.skip();
return;
}
expect(loaded, 'App should load without deadlock').toBe(true);
// Extract hardware_concurrency from logs
const hwLog = testLogger.consoleLogs.find(log =>
log.includes('[THREADPOOL] hardware_concurrency:')
);
expect(hwLog, 'Should find hardware_concurrency log').toBeDefined();
if (!hwLog) {
console.log('Could not find hardware_concurrency log');
return;
}
const match = hwLog!.match(/hardware_concurrency:\s*(\d+)/);
expect(match, 'Should parse hardware_concurrency value').not.toBeNull();
const match = hwLog.match(/hardware_concurrency:\s*(\d+)/);
if (!match) {
console.log('Could not parse hardware_concurrency value');
return;
}
const expectedThreads = parseInt(match[1], 10);
console.log(`Expected ${expectedThreads} threads based on hardware_concurrency`);
const expectedThreads = parseInt(match![1], 10);
// Count "Thread X started" messages
const threadStartedLogs = testLogger.consoleLogs.filter(log =>
log.includes('[THREADPOOL] Thread') && log.includes('started')
);
console.log(`Found ${threadStartedLogs.length} "Thread started" messages`);
// All threads should have started
expect(threadStartedLogs.length).toBe(expectedThreads);
});