View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011125CDashpublic2010-08-13 04:152010-10-25 02:36
ReporterChris Hillery 
Assigned ToJulien Jomier 
PlatformOSOS Version
Product Version1.6.4 
Target VersionFixed in Version1.8 
Summary0011125: Test.Exists() uses incomplete key, resulting in bogus test associations in DB
DescriptionThe index for the "test" table comprises the crc32, name, and projectid fields, where the crc32 field is a CRC calculated over several other fields such as the command and output text.

However, Test.Exists() only checks the database for an entry matching the crc32 and projectid fields. Since a 32-bit CRC is definitely not guaranteed to be unique, this can result in Test incorrectly concluding that a match exists, with the result that a submitted build is associated with tests from other builds.

This isn't a theoretical problem; I tracked it down because it was occurring regularly with our nightly tests. I could see that the correct tests were run and were in the uploaded .xml files, but viewing the CDash webpage showed different tests for those builds.
Additional InformationI have attached a trivial patch which corrects the problem for us.
TagsNo tags attached.
Attached Filestxt file icon fix-test-exists-patch.txt [^] (827 bytes) 2010-08-13 04:15 [Show Content]


Julien Jomier (manager)
2010-08-13 08:22

This is interesting. We did see some crc32 collisions across projects on some servers running a lot of project, but never within a project (that's why we added the projectid check not so long ago). I guess we have to check with the name too as suggested (this is going to be much slower regretfully).
Chris Hillery (reporter)
2010-08-13 19:36

For reference, our project has 25 nightly builds. There are 35,000 or so unique test names, and each build runs some subset (there are many overlaps). We discovered this problem because one build, which runs about 20,000 tests, was regularly showing about 10 tests from other builds.

Sorry to say, but a crc32 simply isn't a unique key! :) In fact, even with my patch, the possibility exists for collisions, although it would most likely require a fairly unusual set of circumstances (eg., different tests with the same name).

Since the test table has an index on the 'name' field, I do not think my change will be "much slower". I didn't do careful analysis, but I haven't noticed any significant change with our project.

Still, if this was a concern, the existing single-column indexes could be either replaced by or supplemented with a true multi-column index over the crc32,name,projectid fields. Since mysql (and I assume postgres) can use left subsets of multi-column indexes, probably the three separate indexes could be replaced entirely with the single multi-column index, which would therefore probably not take significantly more disk space.
Julien Jomier (manager)
2010-08-26 12:37

Patch committed. Thanks for the report.

 Issue History
Date Modified Username Field Change
2010-08-13 04:15 Chris Hillery New Issue
2010-08-13 04:15 Chris Hillery File Added: fix-test-exists-patch.txt
2010-08-13 08:22 Julien Jomier Note Added: 0021741
2010-08-13 19:36 Chris Hillery Note Added: 0021747
2010-08-26 11:08 Julien Jomier Status new => assigned
2010-08-26 11:08 Julien Jomier Assigned To => Julien Jomier
2010-08-26 12:37 Julien Jomier Note Added: 0021976
2010-08-26 12:37 Julien Jomier Status assigned => resolved
2010-08-26 12:37 Julien Jomier Fixed in Version => 1.8
2010-08-26 12:37 Julien Jomier Resolution open => fixed
2010-10-25 02:36 Julien Jomier Status resolved => closed

Copyright © 2000 - 2018 MantisBT Team