Ticket #332 (new defect)
Static tests overwrite .class file generated by testSystem
| Reported by: | jmaessen | Owned by: | EricAllen |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | static analysis | Version: | |
| Keywords: | Cc: |
Description
Both static_tests and tests contained a test called InheritedMethod. When running ant test both files attempt to generate the cached environment file ./default_repository/caches/environment_cache/InheritedMethodComponentEnv_19e7fe8b.class. However, they want to put completely different stuff into this file. The static_tests version merrily overwrites this file even if it is already present in the cache, while the interpreter is more careful and loads the one it finds in the cache rather than writing a fresh file. This causes testSystem to fail consistently on my machine, starting from the time I first run ant test.
There are a few things to note here:
- We should never be overwriting a file in the cache if that file already exists. Write-protecting the cache after ant testSystem was very enlightening; testSystem is repeatable but static_tests die.
- Why do these files choose the same hash code? Is this because we're not accounting for the necessary information ('such as the full path to the original source file') or because we've chosen a lousy hash and consequently encountered a collision? If the latter, perhaps we can afford to spring for a 64-bit hash?
- Should we consider write-protecting cache files just to guard against this kind of bug in future?
Change History
Note: See
TracTickets for help on using
tickets.

