Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.0.GA, 1.1.0.M1
-
None
-
A commit to the trunk caused a strange error message to appear:
null
Traceback (most recent call last):
File "/opt/python/python-2.5.4/lib/python2.5/unittest.py", line 260, in run
testMethod()
File "/opt/j2ee/domains/springframework.org/build/bamboo-home/xml-data/build-dir/EXT-PYQUICK/springpython/test/springpythontest/contextTestCases.py", line 970, in testAThirdComplexContainer
self.fail("Cannot handle %s" % type(item))
File "/opt/python/python-2.5.4/lib/python2.5/unittest.py", line 301, in fail
raise self.failureException, msg
AssertionError: Cannot handle <class 'springpython.config.FrozenSetDef'>
It worked on my machine every time, but failed on the CI server in fluctuating fashion.A commit to the trunk caused a strange error message to appear: null Traceback (most recent call last): File "/opt/python/python-2.5.4/lib/python2.5/unittest.py", line 260, in run testMethod() File "/opt/j2ee/domains/springframework.org/build/bamboo-home/xml-data/build-dir/EXT-PYQUICK/springpython/test/springpythontest/contextTestCases.py", line 970, in testAThirdComplexContainer self.fail("Cannot handle %s" % type(item)) File "/opt/python/python-2.5.4/lib/python2.5/unittest.py", line 301, in fail raise self.failureException, msg AssertionError: Cannot handle <class 'springpython.config.FrozenSetDef'> It worked on my machine every time, but failed on the CI server in fluctuating fashion.
Description
After picking through the code, and turning the debug message level WAY UP, found out that bug was in Set and FrozenSet processing of the IoC container.
Sets are unordered list, and different machines order things differently. The process to replace object definitions with object actuals was coded as an iterate-remove-add procedure, since we couldn't directly write into the entry of the set. Removing and then adding to a set while iterating over it has undefined behavior. While it worked on my machine, it failed with fluctuation on the CI server.
Proper set handling behavior is to iterate over original set, and add to new set, then replace existing set with new one.