Changeset 6ef75fa6 in sasview for test


Ignore:
Timestamp:
May 5, 2018 1:23:09 AM (7 years ago)
Author:
Stuart Prescott <stuart@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
0863065
Parents:
7d5e7da
git-author:
Stuart Prescott <stuart@…> (01/19/18 17:59:53)
git-committer:
Stuart Prescott <stuart@…> (05/05/18 01:23:09)
Message:

Fix race condition in test

transform_isrunning() returns False both before the calculation has started
and also after the calculation has finished. The test of the transformation
was only considering the latter case and so was regularly failing on the
reproducible-builds.org test infrastructure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/corfunc/test/utest_corfunc.py

    rf53d684 r6ef75fa6  
    7474        while True: 
    7575            time.sleep(0.001) 
    76             if not self.calculator.transform_isrunning(): 
     76            if (not self.calculator.transform_isrunning() and 
     77                self.transformation is not None): 
    7778                break 
    7879 
    79     def transform_callback(self, transforms): 
    80         transform1, transform3, idf = transforms 
     80        transform1, transform3, idf = self.transformation 
    8181        self.assertIsNotNone(transform1) 
    8282        self.assertAlmostEqual(transform1.y[0], 1) 
    8383        self.assertAlmostEqual(transform1.y[-1], 0, 5) 
     84 
     85    def transform_callback(self, transforms): 
    8486        self.transformation = transforms 
    8587 
Note: See TracChangeset for help on using the changeset viewer.