Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Switch to zodbpickle #10

Merged
merged 1 commit into from
Nov 12, 2021
Merged

Conversation

navytux
Copy link
Contributor

@navytux navytux commented Nov 11, 2021

Else, when ran agains ZODB5 it crashes like below and almost no tests
are run:

Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
......

Failure in test test_mixed_compressed_and_uncompressed_and_packing (zc.zlibstorage.tests)
Failed doctest test for zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing
  File "/home/kirr/src/wendelin/z/zc.zlibstorage/src/zc/zlibstorage/tests.py", line 131, in test_mixed_compressed_and_uncompressed_and_packing

----------------------------------------------------------------------
File "/home/kirr/src/wendelin/z/zc.zlibstorage/src/zc/zlibstorage/tests.py", line 167, in zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing
Failed example:
    pickle.loads(zlib.decompress(data[2:]))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing[19]>", line 1, in <module>
        pickle.loads(zlib.decompress(data[2:]))
      File "/usr/lib/python2.7/pickle.py", line 1388, in loads
        return Unpickler(file).load()
      File "/usr/lib/python2.7/pickle.py", line 864, in load
        dispatch[key](self)
      File "/usr/lib/python2.7/pickle.py", line 892, in load_proto
        raise ValueError, "unsupported pickle protocol: %d" % proto
    ValueError: unsupported pickle protocol: 3

After this patch testing is in much better shape but the tests still don't fully pass due to failure in
checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests):

(neo) (z-dev) (g.env) kirr@deca:~/src/wendelin/z/zc.zlibstorage$ zope-testrunner --test-path=src -v
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
.......
  Ran 7 tests with 0 failures, 0 errors and 0 skipped in 0.029 seconds.
Running .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests tests:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests in 0.000 seconds.
  Running:
................................................................................

Failure in test checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOServerZlibTests)
Traceback (most recent call last):
  File "/usr/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/tests/IteratorStorage.py", line 115, in checkTransactionExtensionFromIterator
    self.assertNotEqual(extension_bytes, txn.extension_bytes)
  File "/usr/lib/python2.7/unittest/case.py", line 522, in assertNotEqual
    raise self.failureException(msg)
AssertionError: '\x80\x03}q\x01U\x03fooK\x01s.' == '\x80\x03}q\x01U\x03fooK\x01s.'

.........................
  Ran 105 tests with 1 failures, 0 errors and 0 skipped in 18.029 seconds.
Running .zlibstoragetests.FileStorageClientZlibZEOZlibTests tests:
  Tear down .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageClientZlibZEOZlibTests in 0.000 seconds.
  Running:
................................................................................

Failure in test checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests)
Traceback (most recent call last):
  File "/usr/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/tests/IteratorStorage.py", line 115, in checkTransactionExtensionFromIterator
    self.assertNotEqual(extension_bytes, txn.extension_bytes)
  File "/usr/lib/python2.7/unittest/case.py", line 522, in assertNotEqual
    raise self.failureException(msg)
AssertionError: '\x80\x03}q\x01U\x03fooK\x01s.' == '\x80\x03}q\x01U\x03fooK\x01s.'

.........................
  Ran 105 tests with 1 failures, 0 errors and 0 skipped in 17.240 seconds.
Running .zlibstoragetests.FileStorageZEOZlibTests tests:
  Tear down .zlibstoragetests.FileStorageClientZlibZEOZlibTests in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageZEOZlibTests in 0.000 seconds.
  Running:
.........................................................................................................
  Ran 105 tests with 0 failures, 0 errors and 0 skipped in 17.808 seconds.
Running .zlibstoragetests.FileStorageZlibRecoveryTest tests:
  Tear down .zlibstoragetests.FileStorageZEOZlibTests in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageZlibRecoveryTest in 0.000 seconds.
  Running:
....
  Ran 4 tests with 0 failures, 0 errors and 0 skipped in 0.013 seconds.
Running .zlibstoragetests.FileStorageZlibTests tests:
  Tear down .zlibstoragetests.FileStorageZlibRecoveryTest in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageZlibTests in 0.000 seconds.
  Running:
......................................................................................................
  Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.505 seconds.
Running .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled tests:
  Tear down .zlibstoragetests.FileStorageZlibTests in 0.000 seconds.
  Set up .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled in 0.000 seconds.
  Running:
......................................................................................................
  Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.660 seconds.
Running zc.zlibstorage.tests.ZLibHackLayer tests:
  Tear down .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled in 0.000 seconds.
  Set up zc.zlibstorage.tests.ZLibHackLayer in 0.000 seconds.
  Running:
......................................................................................................
  Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.754 seconds.
Tearing down left over layers:
  Tear down zc.zlibstorage.tests.ZLibHackLayer in 0.000 seconds.

Tests with failures:
   checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOServerZlibTests)
   checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests)
Total: 632 tests, 2 failures, 0 errors and 3 skipped in 1 minutes 13.340 seconds.

Else, when ran agains ZODB5 it crashes like below and almost no tests
are run:

    Running tests at level 1
    Running zope.testrunner.layer.UnitTests tests:
      Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
      Running:
    ......

    Failure in test test_mixed_compressed_and_uncompressed_and_packing (zc.zlibstorage.tests)
    Failed doctest test for zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing
      File "/home/kirr/src/wendelin/z/zc.zlibstorage/src/zc/zlibstorage/tests.py", line 131, in test_mixed_compressed_and_uncompressed_and_packing

    ----------------------------------------------------------------------
    File "/home/kirr/src/wendelin/z/zc.zlibstorage/src/zc/zlibstorage/tests.py", line 167, in zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing
    Failed example:
        pickle.loads(zlib.decompress(data[2:]))
    Exception raised:
        Traceback (most recent call last):
          File "/usr/lib/python2.7/doctest.py", line 1315, in __run
            compileflags, 1) in test.globs
          File "<doctest zc.zlibstorage.tests.test_mixed_compressed_and_uncompressed_and_packing[19]>", line 1, in <module>
            pickle.loads(zlib.decompress(data[2:]))
          File "/usr/lib/python2.7/pickle.py", line 1388, in loads
            return Unpickler(file).load()
          File "/usr/lib/python2.7/pickle.py", line 864, in load
            dispatch[key](self)
          File "/usr/lib/python2.7/pickle.py", line 892, in load_proto
            raise ValueError, "unsupported pickle protocol: %d" % proto
        ValueError: unsupported pickle protocol: 3

After this patch testing is in much better shape but the tests still don't fully pass due to failure in
checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests):

    (neo) (z-dev) (g.env) kirr@deca:~/src/wendelin/z/zc.zlibstorage$ zope-testrunner --test-path=src -v
    Running tests at level 1
    Running zope.testrunner.layer.UnitTests tests:
      Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
      Running:
    .......
      Ran 7 tests with 0 failures, 0 errors and 0 skipped in 0.029 seconds.
    Running .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests tests:
      Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests in 0.000 seconds.
      Running:
    ................................................................................

    Failure in test checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOServerZlibTests)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/unittest/case.py", line 329, in run
        testMethod()
      File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/tests/IteratorStorage.py", line 115, in checkTransactionExtensionFromIterator
        self.assertNotEqual(extension_bytes, txn.extension_bytes)
      File "/usr/lib/python2.7/unittest/case.py", line 522, in assertNotEqual
        raise self.failureException(msg)
    AssertionError: '\x80\x03}q\x01U\x03fooK\x01s.' == '\x80\x03}q\x01U\x03fooK\x01s.'

    .........................
      Ran 105 tests with 1 failures, 0 errors and 0 skipped in 18.029 seconds.
    Running .zlibstoragetests.FileStorageClientZlibZEOZlibTests tests:
      Tear down .zlibstoragetests.FileStorageClientZlibZEOServerZlibTests in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageClientZlibZEOZlibTests in 0.000 seconds.
      Running:
    ................................................................................

    Failure in test checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/unittest/case.py", line 329, in run
        testMethod()
      File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/tests/IteratorStorage.py", line 115, in checkTransactionExtensionFromIterator
        self.assertNotEqual(extension_bytes, txn.extension_bytes)
      File "/usr/lib/python2.7/unittest/case.py", line 522, in assertNotEqual
        raise self.failureException(msg)
    AssertionError: '\x80\x03}q\x01U\x03fooK\x01s.' == '\x80\x03}q\x01U\x03fooK\x01s.'

    .........................
      Ran 105 tests with 1 failures, 0 errors and 0 skipped in 17.240 seconds.
    Running .zlibstoragetests.FileStorageZEOZlibTests tests:
      Tear down .zlibstoragetests.FileStorageClientZlibZEOZlibTests in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageZEOZlibTests in 0.000 seconds.
      Running:
    .........................................................................................................
      Ran 105 tests with 0 failures, 0 errors and 0 skipped in 17.808 seconds.
    Running .zlibstoragetests.FileStorageZlibRecoveryTest tests:
      Tear down .zlibstoragetests.FileStorageZEOZlibTests in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageZlibRecoveryTest in 0.000 seconds.
      Running:
    ....
      Ran 4 tests with 0 failures, 0 errors and 0 skipped in 0.013 seconds.
    Running .zlibstoragetests.FileStorageZlibTests tests:
      Tear down .zlibstoragetests.FileStorageZlibRecoveryTest in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageZlibTests in 0.000 seconds.
      Running:
    ......................................................................................................
      Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.505 seconds.
    Running .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled tests:
      Tear down .zlibstoragetests.FileStorageZlibTests in 0.000 seconds.
      Set up .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled in 0.000 seconds.
      Running:
    ......................................................................................................
      Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.660 seconds.
    Running zc.zlibstorage.tests.ZLibHackLayer tests:
      Tear down .zlibstoragetests.FileStorageZlibTestsWithBlobsEnabled in 0.000 seconds.
      Set up zc.zlibstorage.tests.ZLibHackLayer in 0.000 seconds.
      Running:
    ......................................................................................................
      Ran 102 tests with 0 failures, 0 errors and 1 skipped in 6.754 seconds.
    Tearing down left over layers:
      Tear down zc.zlibstorage.tests.ZLibHackLayer in 0.000 seconds.

    Tests with failures:
       checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOServerZlibTests)
       checkTransactionExtensionFromIterator (zc.zlibstorage.tests.FileStorageClientZlibZEOZlibTests)
    Total: 632 tests, 2 failures, 0 errors and 3 skipped in 1 minutes 13.340 seconds.
Copy link
Member

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks sane, but does it run locally on your machine?

On MacOS I get 306 errors for Python 3.6 when running it with tox (Mostly File name too long when creating temp files) and several crashes of the Python interpreter during the test run.

Interestingly I get the same result on master.

@navytux
Copy link
Contributor Author

navytux commented Nov 12, 2021

@icemac, thanks for feedback. This runs mostly ok on my local Linux machine. The full output of such test run is presented in the commit message - please look for and below zc.zlibstorage$ zope-testrunner --test-path=src -v.

Maybe the problems you observe are specific to MacOS and/or specific Python interpreter build (since as you say there are Python interpreter crashes).

@icemac icemac mentioned this pull request Nov 12, 2021
@icemac
Copy link
Member

icemac commented Nov 12, 2021

@navytux I created #12 to run the tests in GHA and it seems that this PR could fix most of the problems over there.

@icemac
Copy link
Member

icemac commented Nov 12, 2021

I am merging this PR and will rebase #12 on it.

@icemac icemac merged commit 51cca6b into zopefoundation:master Nov 12, 2021
@icemac
Copy link
Member

icemac commented Nov 12, 2021

Thank you for this PR. 😃

@navytux
Copy link
Contributor Author

navytux commented Nov 12, 2021

Thanks, @icemac.

@navytux navytux mentioned this pull request Nov 12, 2021
@navytux navytux deleted the y/zodbpickle branch November 15, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants