1. 02 May, 2001 4 commits
    • Jeremy Hylton's avatar
      Fix tests to work correctly with conflict resolution. · 58cfe930
      Jeremy Hylton authored
      Add new tests for conflict resolution.
      
      The old blanket try-except for conflict resolution was hiding some
      bugs caused by the pickles used in the test suite.  The conflict
      resolution code imposes some restrictions on the format of pickles.
      Basically, the conflict resolution requires that the storage API only
      accept a pickles that constructed according to the ZODB rules.
      
      XXX This new restriction sounds unfortunate, but it would require a
      substantial change to conflict resolution to remove it.
      
      The key changes to the test suite are to store only persistent objects
      and to format the pickles using the standard ZODB format.  All tests
      now use ZODB.tests.MinPO.MinPO instances for data.  The pickling is
      down with zodb_pickle() and zodb_unpickle() defined in
      StorageTestBase.
      
      Add conflict resolution tests to testFileStorage.  (They pass.)
      58cfe930
    • Jeremy Hylton's avatar
      Fix conflict resolution bug in transactionalUndo. · 95f9483c
      Jeremy Hylton authored
      The value of _loadBack() -- a pickle and a serialno -- was being
      passed to tryToResolveConflict() where only a pickle was expected.
      
      XXX _loadBack() can raise KeyError, but this wasn't handled by the
      code.  Turn into UndoError() for now.
      95f9483c
    • Jeremy Hylton's avatar
      Replace blanket try-except for all exceptions with try-except for · 23387167
      Jeremy Hylton authored
      exactly one exception, ConflictError
      
      Remove klass._p_resolveConflict line, because it's only apparent
      purpose was to raise an AttributeError that was caught by the blanket
      try-except.  Instead, let the later code, which actually uses
      _p_resolveConflict() catch the AttributeError and return 0.
      23387167
    • Jeremy Hylton's avatar
  2. 01 May, 2001 6 commits
  3. 29 Apr, 2001 1 commit
  4. 27 Apr, 2001 4 commits
  5. 24 Apr, 2001 3 commits
    • Barry Warsaw's avatar
      Two simple, but working (for FileStorage at least ;), pack tests. · 377fc848
      Barry Warsaw authored
      checkPackAllRevisions(): Create an object and store three different
      revisions of the object.  Before packing, check to make sure all three
      revisions can be loaded.  After packing, make sure all revisions are
      gone (since they were not referenced by the root object, they are
      garbage).
      
      checkPackJustOldRevisions(): Same as above, but this time create a
      root object and a link from the root object to the persistent object.
      Then store three different revisions of the persistent object and make
      sure all three revisions can be loaded.  After packing, make sure the
      first two revisions are gone, but that the third revision (and the
      root object) can be loaded.
      
      Other changes:
      
      - Add a ZERO global
      
      - Add a Root class which does /not/ have a getoid() method (so its
        state will be pickled as normal, but attributes that point to
        `persistent' objects will be serialized as persistent ids).
      
      - dumps(): In getpersid(), return None if the object has no getoid()
        method.  This ensures that the root object will get pickled
        correctly as described above.
      
      - _newobj(), _makeloader(): Move these into a common base class called
        PackableStorageBase.  This base class also maintains the cache of
        persistent ids to Object instances, for unpickling.
      
      - PackableStorage is the derived class that contains the actual tests.
      377fc848
    • Jeremy Hylton's avatar
    • Jeremy Hylton's avatar
  6. 20 Apr, 2001 3 commits
  7. 19 Apr, 2001 6 commits
  8. 14 Apr, 2001 3 commits
  9. 13 Apr, 2001 3 commits
    • Barry Warsaw's avatar
      Added tpc_vote() infrastructure along the lines of tpc_begin() and · 0cbd1f05
      Barry Warsaw authored
      tpc_finish(); i.e. it acquires the lock, checks the argument, and then
      calls self._vote().  Note that the transaction passed to tpc_vote()
      isn't passed to self._vote(), since I don't what would be useful.
      
      BaseStorage._vote(): current no-op.
      0cbd1f05
    • Barry Warsaw's avatar
      Added two tests to specifically (and only) focus in on the one · c60df608
      Barry Warsaw authored
      remaining problem with full Berkeley storage's transactionalUndo().
      Specifically:
      
          tid 1: create object 1
          tid 2: modify object 1
          tid 3: undo tid 2
          ----------------------
          tid 4: undo tid 1 (1st alternative universe)
          ----------------------
          tid 4: undo tid 3 (2nd alternative universe)
      
      The new tests are checkUndoCreationBranch1() and
      checkUndoCreationBranch2(), corresponding to alternative universes 1
      and 2, respectively.  Full storage currently fails a.u. #2.
      FileStorage passes.
      c60df608
    • Barry Warsaw's avatar
      Trivial formatting fixes · f8d1d748
      Barry Warsaw authored
      f8d1d748
  10. 12 Apr, 2001 7 commits