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

Test failures with new 0.26.2 release #748

Closed
petefwalter opened this issue Dec 1, 2017 · 2 comments · Fixed by #753
Closed

Test failures with new 0.26.2 release #748

petefwalter opened this issue Dec 1, 2017 · 2 comments · Fixed by #753

Comments

@petefwalter
Copy link

After #744 pygit2 self tests are randomly failing with what looks like memory corruption:

======================================================================
FAIL: test_patch_create_from_blob_buffer (test.test_patch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pygit2-0.26.2/test/test_patch.py", line 110, in test_patch_create_from_blob_buffer
    self.assertEqual(patch.patch, BLOB_PATCH)
AssertionError: u'diff --git a/a/file b/b/file\nindex a520c24..d675fa4 100644\n--- a/a/file\n+++ [truncated]... != u'diff --git a/a/file b/b/file\nindex a520c24..d675fa4 100644\n--- a/a/file\n+++ [truncated]...
  diff --git a/a/file b/b/file
  index a520c24..d675fa4 100644
  --- a/a/file
  +++ b/b/file
  @@ -1,3 +1 @@
- -+ -hello world
+ -hola mundo
+ -bonjour le monde
+ +foo bar
======================================================================
FAIL: test_patch_create_from_blob_buffer_delete (test.test_patch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pygit2-0.26.2/test/test_patch.py", line 132, in test_patch_create_from_blob_buffer_delete
    self.assertEqual(patch.patch, BLOB_PATCH_DELETED)
AssertionError: u'diff --git a/a/file b/b/file\ndeleted file mode 100644\nindex a520c24..0000000 [truncated]... != u'diff --git a/a/file b/b/file\ndeleted file mode 100644\nindex a520c24..0000000 [truncated]...
  diff --git a/a/file b/b/file
  deleted file mode 100644
  index a520c24..0000000
  --- a/a/file
  +++ /dev/null
  @@ -1,3 +0,0 @@
- -+ -hello world
+ -hola mundo
+ -bonjour le monde
======================================================================
FAIL: test_patch_create_from_blobs (test.test_patch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pygit2-0.26.2/test/test_patch.py", line 99, in test_patch_create_from_blobs
    self.assertEqual(patch.patch, BLOB_PATCH)
AssertionError: u'diff --git a/a/file b/b/file\nindex a520c24..d675fa4 100644\n--- a/a/file\n+++ [truncated]... != u'diff --git a/a/file b/b/file\nindex a520c24..d675fa4 100644\n--- a/a/file\n+++ [truncated]...
  diff --git a/a/file b/b/file
  index a520c24..d675fa4 100644
  --- a/a/file
  +++ b/b/file
  @@ -1,3 +1 @@
- -0\ufffd�- @+ -hello world
+ -hola mundo
+ -bonjour le monde
+ +foo bar
----------------------------------------------------------------------
@brandonio21
Copy link
Contributor

You're right. I'm getting this as well... But I'm unsure of the cause

@brandonio21
Copy link
Contributor

brandonio21 commented Dec 3, 2017

Looks like there is some strange problem with create_blob in this test case. The test case is:

old_blob = self.repo.create_blob(CONTENT)
patch = Patch.create_from(self.repo[old_blob], ..)

Which causes this error. However, if we do

old_blob = self.repo[OLD_BLOB_SHA]
patch = Patch.create_from(old_blob, ...)

The problem is solved. So, either:

  1. Something is messed up with create_blob
  2. I am doing something entirely wrong (??)

I don't have the bandwidth to look into create_blob, but I'll put up a PR that switches the test cases to pass. Hopefully with the Windows build fixes and the fixed tests, we can get 0.26.3 released

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 a pull request may close this issue.

2 participants