Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] JUnit plugin DSF tests failing after upgrading to Eclipse 4.6

> Hi all,
> We have JUnit plugin DSF tests that were based on some old DSF tests that I found years ago.  They ran with no problems in Eclipse 4.5 but after we upgraded to Eclipse 4.6, all of our tests fail because it asserts on this line in DsfServicesTracker.getServiceReference():
> assert session.getExecutor().isInExecutorThread();

This line has been there since 2009.

> It looks like the launch delegate's launch() method isn't being executed on the DSF executor thread because if we try to call DsfServiceTracker's getService() method, it asserts.

If you are using a DsfTracker you should wrap it in a DSF executor call.  You can look at GdbLaunchDelegate.launch and see how it eventually uses a query to do DSF stuff.

> Any ideas on why it doesn't work any more and how to fix this?

My guess is that 4.6 automatically adds -ea to the arguments of your launch configuration.
I just tried creating new launch configuration for Junit plugin-tests and I see that the Arguments
tab is automatically filled with -ea.  This may not have been the case before.

It would mean your unit tests always had that issue, you just didn't run with assertions enabled.

Marc


Back to the top