Files
Seth Hillbrand 36f0da1556 eeschema: abort async loads before destroying library tables
Background async library loading workers hold raw LIBRARY_TABLE_ROW
pointers into the LIBRARY_TABLE::m_rows vector. When ProjectChanged()
calls LoadProjectTables(), it destroys the old LIBRARY_TABLE objects
via unique_ptr replacement.

The workers were not aborted until after the tables were destroyed,
creating a window where workers could access freed memory.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23480
2026-03-18 12:18:23 -07:00
..
2026-03-05 09:04:36 -08:00
2023-04-24 22:09:36 -04:00
2025-12-22 17:41:59 -08:00
2025-12-22 17:41:59 -08:00
2025-10-15 22:18:52 -04:00
2025-12-22 17:41:59 -08:00
2025-12-22 17:41:59 -08:00
2025-12-22 17:41:59 -08:00
2025-12-22 17:41:59 -08:00
2026-02-02 13:26:21 -08:00

KiCad HTTP / Provider Test Server

This module implements a FastAPI fixture server for two paths:

  • KiCad HTTP library smoke tests
  • embedded remote provider panel tests

FastAPI gives you a test interface at the /docs endpoint to observe the responses for debug.

Dependencies / Setup

uv is a fast Python package installer and resolver written in Rust. uv works best for isolation by automatically managing virtual environments and dependencies without affecting your system Python.

Install uv:

# On macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# Or with pip
pip install uv

Install dependencies:

cd qa/tests/eeschema
uv sync

That's it! uv sync automatically creates an isolated virtual environment and installs all dependencies.

Using pip

# Navigate to directory
cd qa/tests/eeschema

# Create virtual environment (recommended for isolation)
python -m venv .venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows

# Install dependencies
pip install -r requirements.txt

Usage

Run the HTTP/provider test server:

uv run http_lib_test_server.py

Or use:

python http_lib_test_server.py

The server will start on http://127.0.0.1:8000

The server implements both:

  • the KiCad HTTP Library API in the simplest use case
  • provider metadata, OAuth stubs, session bootstrap, embedded provider page, download endpoints
  • compatibility search/manifest endpoints used by lower-level tests

Optional flags:

uv run http_lib_test_server.py --host 127.0.0.1 --port 8000

Testing with KiCad

  1. Start the test server:

    uv run http_lib_test_server.py
    
  2. For HTTP library testing, load http_test.kicad_httplib in KiCad.

  3. For remote provider testing, add a provider whose metadata URL is: http://127.0.0.1:8000/.well-known/kicad-remote-provider

  4. Open the remote symbol panel. The provider page is rendered inside the embedded webview.

  5. Use Sign In to exercise OAuth loopback + KiCad session bootstrap.

License

This script is part of KiCad, licensed under the GNU General Public License v3.0.

For development and testing purposes only. Not intended for production use.