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
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
Using uv (Recommended)
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
-
Start the test server:
uv run http_lib_test_server.py -
For HTTP library testing, load
http_test.kicad_httplibin KiCad. -
For remote provider testing, add a provider whose metadata URL is:
http://127.0.0.1:8000/.well-known/kicad-remote-provider -
Open the remote symbol panel. The provider page is rendered inside the embedded webview.
-
Use
Sign Into 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.