test(bigtable): fix accelerator system-test failures (script import, asyncio loop scope, fd-leak settle) - #21
Open
mutianf wants to merge 3 commits into
Open
Conversation
…ne script Change-Id: I1931809a01f74efe527dde47182519184c3e61bf
…ests share one event loop Change-Id: I239d67260a45a8ea61fed30e7b159c3034add22e
…or lifecycle tests Change-Id: I26cec416404acb3c9cb5b05c00c6ace2cdb14dd7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #19 (accel-18). Fixes three failures surfaced running the accelerator
system suite under the current CI environment (newer pytest / pytest-asyncio).
stress driver as a standalone script —
stress.pyused a top-levelfrom . import _harness, which fails withImportError: attempted relative import with no known parent packagewhen run aspython stress.py(itsdocstring markets hand-running). Guarded on
__package__so bothpython -m tests.system.data.accelerator.stressandpython stress.pywork.pytest-asyncio loop scope — the system suites share session-scoped async
client/table fixtures, which require the tests and those fixtures to run on
one event loop. pytest-asyncio <=0.21 enforced this via the session-scoped
event_loopoverride intests/system/conftest.py; pytest-asyncio >=0.23ignores that override, so fixtures ended up on a different loop than the tests
(
got Future <...> attached to a different loop). Addedpytest.inipinningasyncio_default_fixture_loop_scope/asyncio_default_test_loop_scopetosession, plus a rootconftest.pythat registers those ini options so olderpytest-asyncio doesn't emit an unknown-option warning (fatal under
-W error).No-op on 0.21.2 (keys ignored, override still drives it); full unit suite
(5509) verified green under the config.
fd-leak settle —
test_no_leaks_over_repeated_lifecyclesfailed on fdcount (30->40) while daemon-subprocess and tempdir leak checks passed. That is
the known async-grpc fd high-water (channel fds released lazily on teardown),
not a daemon leak.
assert_no_leaksnow GCs and takes the minimum fd countover a short settle window: a transient teardown high-water drains and passes,
while a genuine per-cycle leak stays high and still fails.
Note: the standard nox
systemsession pins pytest-asyncio==0.21.2, so the realenvironmental cause is a CI harness that installs it unpinned; these repo-side
fixes make the suite robust across both.