Closed bjhargrave closed 10 years ago
Comment author: @bosschaert
The RSA CT makes a number of assertions about events. This happens in the testExportRSAListenerNotification(), testExportEventNotification(), testForceExportFailure() and possibly other tests. The accounting for these events has been changed in the CT for R5 but it looks like things aren't completely correct just yet. Some suggested changes (non-final) that I had to make to get an RSA implementation to pass are in commit 53d760daf467a6f6fcad01bf6735753da7978989 (branch davidb/rsa_ct_fixes3)
Comment author: @bosschaert
org.osgi.test.cases.remoteserviceadmin.tb2.Activator also contains event-based logic that I think should be revisited too.
Comment author: Bram de Kruijff <bram.dekruijff@luminis.eu>
I am not sure it the changes David mentions made it into eeg/rsa_1_1 at some point. There are a lot of comments and commented-out lines of code in this area.
I think the current state wrt the events is that they are logically correct and they do not cause issues with the Amdatu RI. However, they may be a bit brittle in implementation.
The general pattern is..
1) The test registers a service with certain properties 2) The test registers an eventlistener for any and all events 3) The test acts as a topology manager calling exportService on the RSA 4) The test makes assertions on the events that may have happened
This is OK, because the in step 1 the service registered has no exported interfaces. Thus, it does not seem to cause any race conditions with the RI topologymanager.
This is brittle, because there are assertions on (the number of) events without actually testing that received events are for the expected services or endpoints. Thus, services with exported interfaces and concurrent scenarios may cause race conditions.
An example of this issue wrt org.osgi.test.cases.remoteserviceadmin.tb2.Activator can be found at [0].
So IMHO matters could be improved upon by 1) being more explicit through listeners that block on specific event types for specific payloads instead of blocking for any event and only then asserting on the payload, and 2) not asserting on number of events unless that is the actual test.
[0] https://www.osgi.org/members/bugzilla/show_bug.cgi?id=2594
Comment author: Bram de Kruijff <bram.dekruijff@luminis.eu>
May be something we want to address in R6. Reassigning to CT maintainer.
Comment author: Marc Schaaf <marc.schaaf@fhnw.ch>
Made the event handling a more reliable in 4d7e8ce92dd6a5c3e6aa6b3abd14e7c55292709d. Closing it, if any more issues around the event handling arise we can reopen it.
Original bug ID: BZ#2493 From: @bosschaert Reported version: R5