LayoutInstance.query_layout_obj_instances misses one object on Linux
- Dominant language
- Python
- Stars
- 7
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### 🔍 Before submitting the issue
- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment
### 🐞 Description of the bug
Calling `LayoutInstance.query_layout_obj_instances` on Linux results in one object always being left off the end of the list as demonstrated by the test added in https://github.com/ansys/pyedb-core/tree/qloi-bug-example.
The output of the steps below points to this check in `LayoutInstance.query_layout_obj_instances.process_hits` as the culprit:
https://github.com/ansys/pyedb-core/blob/847eb09cba2278f0c169119aa30ee1b9d5296fc3/src/ansys/edb/core/layout_instance/layout_instance.py#L101-L103
When the result is not streamed (as done in this version on Linux due to a server-side issue), the last `hit` pulled from the iterator has `is_end_of_query_results_group==True` which causes the processing of the hit to be skipped even though it contains an `edb_obj` message that should be added to the returned list.
### 📝 Steps to reproduce
1. Check out https://github.com/ansys/pyedb-core/tree/qloi-bug-example
2. Install:
```
[uv] pip install -U -e .[tests]
```
3. Run the test:
```
pytest -v tests/e2e/unit_tests/test_layout_instance.py::test_layout_instance_smoke
```
Output:
```
============================= test session starts ==============================
platform linux -- Python 3.13.13, pytest-8.4.1, pluggy-1.6.0 -- /home/iwaldron/projects/pyedb-core/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/iwaldron/projects/pyedb-core
configfile: pyproject.toml
plugins: mock-3.14.1, cov-6.2.1
collected 1 item
tests/e2e/unit_tests/test_layout_instance.py::test_layout_instance_smoke FAILED [100%]
=================================== FAILURES ===================================
__________________________ test_layout_instance_smoke __________________________
circuit_cell_with_edge_terminals =
def test_layout_instance_smoke(circuit_cell_with_edge_terminals: Cell):
layout = circuit_cell_with_edge_terminals.layout
assert layout is not None
objs = layout.layout_instance.query_layout_obj_instances(["L1"])
> assert len(objs) == 3
E assert 2 == 3
E + where 2 = len([, ])
tests/e2e/unit_tests/test_layout_instance.py:8: AssertionError
----------------------------- Captured stderr call -----------------------------
DEBUG - Hit at end of query results group: edb_obj {
id: 24
}
is_end_of_query_results_group: true
------------------------------ Captured log call -------------------------------
DEBUG edb_client:layout_instance.py:103 Hit at end of query results group: edb_obj {
id: 24
}
is_end_of_query_results_group: true
=========================== short test summary info ============================
FAILED tests/e2e/unit_tests/test_layout_instance.py::test_layout_instance_smoke - assert 2 == 3
============================== 1 failed in 1.90s ===============================
```
### 💻 Which operating system are you using?
Linux
### 📀 Which ANSYS version are you using?
2026 R1
### 🐍 Which Python version are you using?
3.13
### 📦 Installed packages
```shell
ansys-api-edb==0.3.0
-e file:///home/iwaldron/projects/pyedb-core
ansys-tools-common==0.5.0
cachetools==7.1.1
certifi==2026.4.22
charset-normalizer==3.4.7
click==8.3.3
colorama==0.4.6
coverage==7.14.0
distlib==0.4.0
filelock==3.29.0
grpcio==1.80.0
idna==3.14
iniconfig==2.3.0
packaging==26.2
platformdirs==4.9.6
pluggy==1.6.0
protobuf==6.33.6
pygments==2.20.0
pyproject-api==1.10.0
pytest==8.4.1
pytest-cov==6.2.1
pytest-mock==3.14.1
python-discovery==1.3.0
requests==2.33.1
scooby==0.11.2
tomli-w==1.2.0
tox==4.53.1
typing-extensions==4.15.0
urllib3==2.7.0
virtualenv==21.3.1
```
Contributor guide
Research direction
Start in src/ansys/edb/core/layout_instance/layout_instance.py at LayoutInstance.query_layout_obj_instances.process_hits, then run tests/e2e/unit_tests/test_layout_instance.py::test_layout_instance_smoke on Linux. Confirm that the hit containing edb_obj id 24 is included in the returned objects, with the test expecting three objects instead of two.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100