Skip to content

CNPhenology (and other?) unit tests not being run #3015

@samsrabin

Description

@samsrabin

Brief summary of bug

I noticed that I couldn't get tests in test_CNPhenology.pf to fail, even if I did something like @assertTrue(.false.). @ekluzek figured out that this is because it's failing in setUp() at call clm_varcon_init( is_simple_buildtemp = .true.). Specifically, it seems like something is not getting correctly deallocated between tests.

Steps to resolution:

  1. Set up pfunit so that a failure in setUp marks the whole test file as failed.
  2. Fix whatever's wrong in test_CNPhenology.pf's setUp().
  3. Fix any other test files that had been silently failing in setUp().

General bug information

CTSM version you are using: ctsm5.3.031

Does this bug cause significantly incorrect results in the model's science? No, but it might be hiding bugs that would.

Important details of your setup / configuration so we can reproduce the bug

Testing on Derecho.

If I comment out all the tests except check_doonset_normal (the first one), then add @assertTrue( .false. ) at the end of that test, it fails successfully.

If I uncomment the next test (check_doonset_vegdepend_buttemperate), neither test fails.

If I re-comment the latter and then uncomment the last test (test_was_sown_in_this_window_sameday), neither test fails.

If I add a call of endrun() at the end of setUp(), I get the following:

 Start: <test_CNPhenology_suite.check_doonset_normal>
.  ******** CLM Time Manager Configuration ********
   Calendar type:            NO_LEAP
   Timestep size (seconds):          1800
   Start date (yr mon day tod):                1           1           1
           0
   Reference date (yr mon day tod):            1           1           1
           0
   Current step number:                 1
   Current date (yr mon day tod):              1           1           1
        1800
  ************************************************
 ENDRUN:
 Failure in <test_CNPhenology_suite.check_doonset_normal>
F   end: <test_CNPhenology_suite.check_doonset_normal>


 Start: <test_CNPhenology_suite.test_was_sown_in_this_window_sameday>
.  ******** CLM Time Manager Configuration ********
   Calendar type:            NO_LEAP
   Timestep size (seconds):          1800
   Start date (yr mon day tod):                1           1           1
           0
   Reference date (yr mon day tod):            1           1           1
           0
   Current step number:                 1
   Current date (yr mon day tod):              1           1           1
        1800
  ************************************************
forrtl: severe (151): allocatable array is already allocated
Image              PC                Routine            Line        Source
CNPhenology        00000000008113A0  clm_varcon_mp_clm         291  clm_varcon.F90
CNPhenology        00000000004151F1  test_cnphenology_          72  test_CNPhenology.F90
CNPhenology        0000000000A9A44B  pf_testcase_mp_ru         134  TestCase.F90
CNPhenology        0000000000A9A855  pf_testcase_mp_ru         146  TestCase.F90
CNPhenology        0000000000B11B44  pf_testresult_mp_         237  TestResult.F90
CNPhenology        0000000000A9A0E3  pf_testcaserun_mp         121  TestCase.F90
CNPhenology        0000000000A99A9C  pf_testcase_mp_ru         108  TestCase.F90
CNPhenology        0000000000A9F7DA  pf_testsuite_mp_r         108  TestSuite.F90
CNPhenology        0000000000A9F7DA  pf_testsuite_mp_r         108  TestSuite.F90
CNPhenology        0000000000B183FB  pf_testrunner_mp_         139  TestRunner.F90
CNPhenology        0000000000B17528  pf_testrunner_mp_         117  TestRunner.F90
CNPhenology        0000000000AB7201  funit_mp_generic_         118  FUnit.F90
CNPhenology        0000000000AB0C47  funit_mp_run_              33  FUnit.F90
CNPhenology        0000000000ABA1D4  funit_main_                16  funit_main.F90
CNPhenology        000000000041B119  MAIN__                     82  CNPhenology_driver.F90
CNPhenology        000000000041497D  Unknown               Unknown  Unknown
libc-2.31.so       00007FF51417C29D  __libc_start_main     Unknown  Unknown
CNPhenology        00000000004148AA  Unknown               Unknown  Unknown

I thought maybe tearDown() wasn't getting called, but when I paste the contents of tearDown() at the end of the first test, it doesn't make a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething is working incorrectlypriority: highHigh priority to fix/merge soon, e.g., because it is a problem in important configurationstestingadditions or changes to tests

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions