Skip to content

Run the error handler registration test in isolation - #173

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/handler-registration-test-isolated
Oct 11, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/handler-registration-test-isolated

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The tests of jmeos-core run concurrently, classes and methods alike (junit-platform.properties),
and the binding holds only the latest error handler MEOS receives, in the static field the wrapper
of meos_initialize_error_handler fills. ErrorHandlerRegistrationTest registers a handler it keeps
no reference to and checks that a collection leaves it reachable, so a handler registered
meanwhile, by the other test of the class or by a class such as STBoxTest, replaces the one it
checks and leaves that one to the collector. The class is @isolated, as MeosInitializeHandlerTest
is, so nothing registers a handler while it runs.

Witness: the fork run 38103656194 of JMEOS #172 at 89fd5ee fails
ErrorHandlerRegistrationTest.unreferencedHandlerStaysReachable with "the registered handler was
collected while MEOS holds it", while the upstream run 38103672322 of the same commit passes it.

Measured over MobilityDB 3a8e6dba09 and the catalog of MEOS-API 4baf11705c: three runs of the
jmeos-core suite pass 1804 tests each, the two of ErrorHandlerRegistrationTest among them.

Why: a test of the binding's handler answers for the binding, not for the order in which the
concurrent tests register theirs.

The tests of jmeos-core run concurrently, classes and methods alike (junit-platform.properties),
and the binding holds only the latest error handler MEOS receives, in the static field the wrapper
of meos_initialize_error_handler fills. ErrorHandlerRegistrationTest registers a handler it keeps
no reference to and checks that a collection leaves it reachable, so a handler registered
meanwhile, by the other test of the class or by a class such as STBoxTest, replaces the one it
checks and leaves that one to the collector. The class is @isolated, as MeosInitializeHandlerTest
is, so nothing registers a handler while it runs.

Witness: the fork run 38103656194 of JMEOS MobilityDB#172 at 89fd5ee fails
ErrorHandlerRegistrationTest.unreferencedHandlerStaysReachable with "the registered handler was
collected while MEOS holds it", while the upstream run 38103672322 of the same commit passes it.

Measured over MobilityDB 3a8e6dba09 and the catalog of MEOS-API 4baf11705c: three runs of the
jmeos-core suite pass 1804 tests each, the two of ErrorHandlerRegistrationTest among them.

Why: a test of the binding's handler answers for the binding, not for the order in which the
concurrent tests register theirs.
@estebanzimanyi
estebanzimanyi merged commit fd3bdd5 into MobilityDB:main Oct 11, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/handler-registration-test-isolated branch October 11, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant