OpenMDAO / testflo

A simple python testing framework that can run unit tests under MPI (or not).
Other
3 stars 7 forks source link

Reported durations are incorrect for SubTests #110

Closed swryan closed 6 months ago

swryan commented 6 months ago

When a SubTest is recorded, start_time is not set:

                        if ut_subtests:
                            for sub, err in ut_subtests:
                                subtest = SubTest(sub._subDescription(), self.spec, self.options)
                                subtest.status = status
                                subtest.err_msg = stream_val + err
                                subtest.end_time = time.perf_counter()
                                subtest.memory_usage = get_memory_usage()
                                subs.append(subtest)

Since the default value for start_time is zero, this results in the subtest duration being reported as the value from perf_counter:

================ Max duration tests with duration >= 0.005 sec ================

451863.627 sec - /testflo/tests/test_testflo.py:TestSubTestsMPI.test_subtests
451863.626 sec - /testflo/tests/test_testflo.py:TestSubTests.test_subtests

===============================================================================`
swryan commented 6 months ago

Resolved by #111