Skip to content

RCPTT tests throws exception, as Display is created before workbench initialisation #478

@ngiger

Description

@ngiger

I am currently sponsoring xored to enable running elexis RCPTT test with eclipse target 2022-06.

In a private E-Mail they wrote me the following

On topic of exception in the log you’ve attached - it seems to be caused my mismatch of  Display object.

The error happens, when Display is created in a background execution thread. Display is bound to the thread it is created in, and is not accessible from other threads. To avoid such errors, make sure that no component attempts to create a Display BEFORE workbench initialisation (or at least outside of main execution thread).

Basically, https://github.com/elexis/elexis-3-core/blob/8b28725dd7b1298b1e17d4805238b1be1871dbbc/bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/UiDesk.java#L123 <https://github.com/elexis/elexis-3-core/blob/8b28725dd7b1298b1e17d4805238b1be1871dbbc/bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/UiDesk.java#L123> is not a legitimate approach, if invoked outside of main application thread.
We often see such errors caused by bundle activators - activators may be invoked from any thread at any time (the order is not defined), but they try (and fail) to access Workbench display anyway, then create their own. The issue is  exacerbated by splash screen and dialogs shown before activation of workbench - sometimes they activate offending bundles.

RCPTT does affect order of bundle activation in AUTs but this not considered to be a bug, as the order is not determined in the first place. Indeed, if you see such problem when using RCPTT, there is a chance it will appear in production at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions