Re: Failure testing duplicity 3.0.0
Kenneth Loafman via Duplicity-talk <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.duplicity.general |
|---|---|
| Message-ID | <CAD-_Ma1-wg3Q6Kzt91s9thUXzaEsYHjQpYR82-pmKk4O6q=J1A@mail.gmail.com> |
Here's the patch. ...Ken On Mon, Sep 2, 2024 at 12:09 PM Kenneth Loafman <[email protected]> wrote: > OK, it's not a timing issue, but a test case issue. I'll fix it and > get back to you with a patch for 3.02. > > Seems Python or pytest sometimes remembers stuff from previous tests. > dup_time.curtimestr was set in test_basic and since that ran before > test_suffix all was well. > > Interesting that this has not cropped up earlier since that file has not > changed in a long time. > > ...Ken > > > > > > On Mon, Sep 2, 2024 at 11:28 AM Kenneth Loafman <[email protected]> > wrote: > >> Scott, >> >> Exactly how do you run your tests? What command line? >> >> I do know that this is not a timing issue. test_file_naming does not >> actually create files, just filenames. The tests that do backup, etc.. >> have a 1 second delay in between, so no timing issue. >> >> Are you perhaps running this under Docker? We've had timing issues >> there, but going to the 1 second delay solved that problem years ago. >> >> ...Ken >> >> >> >> On Mon, Sep 2, 2024 at 7:23 AM Scott Hannahs via Duplicity-talk < >> [email protected]> wrote: >> >>> Ede, >>> It might be. But it is intermittent! The last 3 tests built without >>> errors. >>> >>> What is that test that does an assertion "assert dup_time.curtimestr” >>> It is trying to do a get of a gzipped incremental file name from the >>> manifest, but with no volume number? >>> >>> Is the machine too fast during testing that it is creating files with >>> duplicate date/time stamps? >>> >>> -Scott >>> >>> >>> > On Sep 2, 2024, at 06:36, edgar.soldin--- via Duplicity-talk < >>> [email protected]> wrote: >>> > >>> > hey Scott, >>> > >>> > looks like the brew build runs fine >>> https://formulae.brew.sh/formula/duplicity . something with your >>> specific setup? >>> > >>> > can you give more details os version etc. to the box you are building >>> on? unfortunately i can't run latest macOS versions virtually so far, so >>> it' difficult to try to reproduce. >>> > >>> > sunny regards ..ede >>> > >>> > On 02.09.2024 03:46, Scott Hannahs via Duplicity-talk wrote: >>> >> First, I get a lot of errors trying to build 3.0.2, so I will get to >>> them next. >>> >> >>> >> However I get this failure with 3.0.0. It seems that there is an >>> issue with the time of the files? Are they being built too quickly and the >>> timer does not have time to increment? This doesn’t happen on every build. >>> >> >>> >> >>> >> -Scott >>> >> >>> >> testing/unit/test_file_naming.py .F....... >>> [ 92%] >>> >> …. >>> >> >>> >> =================================== FAILURES >>> =================================== >>> >> ____________________________ FileNaming.test_suffix >>> ____________________________ >>> >> >>> >> self = <testing.unit.test_file_naming.FileNaming >>> testMethod=test_suffix> >>> >> >>> >> def test_suffix(self): >>> >> """Test suffix (encrypt/compressed) encoding and generation""" >>> >> file_naming.prepare_regex(force=True) >>> >>> filename = file_naming.get("inc", manifest=1, gzipped=1) >>> >> >>> >> self = <testing.unit.test_file_naming.FileNaming >>> testMethod=test_suffix> >>> >> >>> >> >>> /opt/sw/src/fink.build/duplicity-3.0.0-1/duplicity-rel.3.0.0/testing/unit/test_file_naming.py:102: >>> >> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >>> _ _ _ _ _ >>> >> >>> >> type = 'inc', volume_number = None, manifest = 1, encrypted = False, >>> gzipped = 1 >>> >> partial = False >>> >> >>> >> def get( >>> >> type, >>> >> volume_number=None, >>> >> manifest=False, # pylint: disable=redefined-builtin >>> >> encrypted=False, >>> >> gzipped=False, >>> >> partial=False, >>> >> ): >>> >> """ >>> >> Return duplicity filename of specified type >>> >> >>> >> type can be "full", "inc", "full-sig", "new-sig", >>> "full-stat", "inc-stat". volume_number >>> >> can be given with the full and inc types. If manifest is >>> true the >>> >> filename is of a full or inc manifest file. >>> >> """ >>> >>> assert dup_time.curtimestr >>> >> E AssertionError >>> >> >>> >> encrypted = False >>> >> gzipped = 1 >>> >> manifest = 1 >>> >> partial = False >>> >> type = 'inc' >>> >> volume_number = None >>> >> >>> >> >>> /opt/sw/src/fink.build/duplicity-3.0.0-1/duplicity-rel.3.0.0/duplicity/file_naming.py:253: >>> AssertionError >>> >> >>> >> >>> >> _______________________________________________ >>> >> Duplicity-talk mailing list >>> >> [email protected] >>> >> https://lists.nongnu.org/mailman/listinfo/duplicity-talk >>> > >>> > _______________________________________________ >>> > Duplicity-talk mailing list >>> > [email protected] >>> > https://lists.nongnu.org/mailman/listinfo/duplicity-talk >>> >>> >>> _______________________________________________ >>> Duplicity-talk mailing list >>> [email protected] >>> https://lists.nongnu.org/mailman/listinfo/duplicity-talk >>> >> _______________________________________________ Duplicity-talk mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/duplicity-talk
chg_test__Fix_unit_test_file_naming_py_.patch
(application/octet-stream, 1.3 KB)
Subject: [PATCH] chg:test: Fix unit/test_file_naming.py.
---
Index: testing/unit/test_file_naming.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/testing/unit/test_file_naming.py b/testing/unit/test_file_naming.py
--- a/testing/unit/test_file_naming.py (revision d8447dfc9ae9a6b63cc069e05422d1fafc7af358)
+++ b/testing/unit/test_file_naming.py (revision 9302439f10d0324de8e6d437e4ea27bcc32e8a63)
@@ -55,9 +55,6 @@
def test_basic(self):
"""Check get/parse cycle"""
- dup_time.setprevtime(10)
- dup_time.setcurtime(20)
-
file_naming.prepare_regex(force=True)
filename = file_naming.get("inc", volume_number=23)
log.Info(f"Inc filename: {os.fsdecode(filename)}")
@@ -162,6 +159,8 @@
def setUp(self):
super().setUp()
+ dup_time.setprevtime(10)
+ dup_time.setcurtime(20)
class FileNamingPrefixes(UnitTestCase, FileNamingBase):
@@ -174,6 +173,8 @@
self.set_config("file_prefix_signature", b"sign-")
self.set_config("file_prefix_archive", b"arch-")
self.set_config("file_prefix_jsonstat", b"jsonstat-")
+ dup_time.setprevtime(10)
+ dup_time.setcurtime(20)
if __name__ == "__main__":