Unit tests not performed once 'not_working_in_parallel' called

Bug #832441 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
High
Unassigned

Bug Description

If the function 'not_working_in_parallel("...")' is called in the DOLFIN library during a unit test function, the Python unit test script exits and any remaining tests in a file are not performed.

Changed in dolfin:
milestone: none → 1.0-rc1
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Johannes Ring (johannr) wrote :

Isn't it bad to call exit() in a shared library? Wouldn't it be better to return an appropriate error code or throw an exception in not_working_in_parallel?

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 832441] Re: Unit tests not performed once 'not_working_in_parallel' called

On Wed, Aug 24, 2011 at 11:57:46AM -0000, Johannes Ring wrote:
> Isn't it bad to call exit() in a shared library? Wouldn't it be better
> to return an appropriate error code or throw an exception in
> not_working_in_parallel?

Yes, I'm working on it.

--
Anders

Revision history for this message
Garth Wells (garth-wells) wrote : Re: [Bug 832441] Re: Unit tests not performed once 'not_working_in_parallel' called

If we add a custom C++ exception for 'not working in parallel', could
the rgression tests catch this and print a graceful message?

Garth

On 24/08/11 08:12, Anders Logg wrote:
> On Wed, Aug 24, 2011 at 11:57:46AM -0000, Johannes Ring wrote:
>> Isn't it bad to call exit() in a shared library? Wouldn't it be better
>> to return an appropriate error code or throw an exception in
>> not_working_in_parallel?
>
> Yes, I'm working on it.
>
> --
> Anders
>

Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 832441] Re: Unit tests not performedonce 'not_working_in_parallel'called

> If we add a custom C++ exception for 'not working in parallel', could
> the rgression tests catch this and print a graceful message?

I do not think there is an automatic way to solve this.

All C++ expceptions get translated into RuntimeErrors in Python. We then have
to run each test in a try except clause and silently accept an error with the
string "not working in parallel", and otherwise rethrow the exception. But
that sounds quite tedious...

Johan

Anders Logg (logg)
Changed in dolfin:
status: Confirmed → Fix Committed
Anders Logg (logg)
Changed in dolfin:
milestone: 1.0-rc1 → 1.0-beta2
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.