- 21 Feb, 2022 1 commit
-
-
Vincent Pelletier authored
This reverts commit 77b3f202. For some obscure reason, this affects unit tests related to inventory unit conversion. There seems to be too much code to cleanup to keep this patch for now, so drop it.
-
- 17 Feb, 2022 7 commits
-
-
Romain Courteaud authored
Fallback to modification_date if a document does not have an effective_date.
-
Vincent Pelletier authored
Indexation activities may spawn further activities, and for_each_activity expects the number of activities after a test to be zero.
-
Vincent Pelletier authored
-
Vincent Pelletier authored
-
Vincent Pelletier authored
System user should be more reliable than whatever user has ownership of catalog tool (which may have its account closed or its roles changed).
-
Vincent Pelletier authored
CMFActivity: Fix ActivityRuntimeEnvironment.getPriority when activity was not loaded from an SQL queue. This happens when activities are being flushed from the ActivityBuffer directly, without being inserted into and then loaded from the SQL queue. It is unclear whether there are uses of this pattern besides testCMFActivity, but it is easy enough to fix.
-
Vincent Pelletier authored
Checking activity presence/absence is not enough: it risks both false negatives and false positives. Instead, manually poison the catalog's content and check which value we retrieve after executing spawned activities (if any).
-
- 16 Feb, 2022 10 commits
-
-
Xiaowu Zhang authored
it's not finished, rework if need
-
Vincent Pelletier authored
-
Georgios Dagkakis authored
- Remove trailing whitespaces - Follow guidelines - Fixup types
-
Vincent Pelletier authored
Also, use it in Products.ERP5Type.tests.ERP5TypeTestCase.
-
Vincent Pelletier authored
-
Vincent Pelletier authored
The only use 'my_' has above 'your_' is to provide a default field value without needing a TALES expression. This only gets applied based on the field ID in the form being rendered. Field libraries are never meant to be rendered, so using 'my_' is always (if harmless) pointless. What really matters for the field naming convention (which exist to avoid collisions with form properties) is that *some* prefix is used, be it 'my_' or 'your_'. So update this check rule to tolerate 'your_' prefixes in addition to 'my_'. Also, use 'not any([...])' instead of 'not 1 in [...]'.
-
Vincent Pelletier authored
I guess this is the intention of the unnecessary pair or parentheses.
-
Vincent Pelletier authored
"Certificate Authority" is a bit long, especially as it is often followed by some other word ("Certificate", ...).
-
Vincent Pelletier authored
-
Vincent Pelletier authored
Abbreviations must be upper-case.
-
- 15 Feb, 2022 3 commits
-
-
Xiaowu Zhang authored
-
Xiaowu Zhang authored
-
Xiaowu Zhang authored
-
- 14 Feb, 2022 1 commit
-
-
Vincent Pelletier authored
The precise number of entries in a bucket depend on an estimation of the size of a pickle. The pickled data contains DateTime objects, making an equality test brittle: - DateTime's timezones are stored as strings (ex: 'GMT') whose length depend on Zope's timezone, which is variable - DateTime's time is stored as a floating-point value represented as a string whose length depends on the number of units and decimals are necessary to represent its value, both being variable (one based on when the test was run, the other based on clock precision and exact test execution timing) Instead, restore the originally-considered-acceptable boundary (24) and verify that the generated value is greater or equal to it. If 24 is considered too small to be acceptable, then it is a decision independent from the present change.
-
- 13 Feb, 2022 1 commit
-
-
Julien Muchembled authored
-
- 10 Feb, 2022 4 commits
-
-
Roque authored
See merge request nexedi/erp5!1553
-
Roque authored
-
Roque authored
-
Jérome Perrin authored
Some combinations of periodicity, for example repeat every first week of the year and every month February are impossible (because the first week of the year is always in January) and such configurations caused infinite loops or probably overflow if we wait long enough. The algorithm being to try the next day until all constraints are met, it is not guaranteed to terminate. To make sure the algorithm terminate, we rely on the fact that calendars repeat after some time, so if after a few years we did not find a matching combination, we can stop retrying. according to https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week > Each leap year repeats once every 28 years, and every common year > repeats once every 6 years and twice every 11 years. so trying for 28 years should be enough to see all combinations
-
- 09 Feb, 2022 1 commit
-
-
Jérome Perrin authored
-
- 08 Feb, 2022 5 commits
-
-
Jérome Perrin authored
In ZODB 5, with commit b6ac40f1 (Uses an unwrapped transaction manager, 2018-10-14) the transaction is bound to the thread opening the connection. The previous pattern of opening transaction in the main thread and passing the already-open connection to the working thread caused the working thread connection to be managed by the main thread connection and in ZODB 5 cause the test to block. Fix this by passing a connection factory method and opening connection in working thread. Also simplify closing of connection by using a closing context manager.
-
Jérome Perrin authored
With upcoming ZODB 5, oids (used as persistent references in pickles) are no longer str as it use to be with ZODB 4, but instances of zodbpickle.binary, which with zodbpickle 1 are a subclass of str on python2. OrderedPickler was a subclass of pickle.Pickler, the pickler from standard library, but this pickler was not able to use a str subclass for persistent references, when pickles are loaded with noload method, persistent_load is called with `None` instead of the actual string subclass instance. This was problematic in the XMLExportImport handling of business templates, because ZODB.serialize.referencesf was unable to find persistent references. The error was: ZODB-5.6.0-py2.7.egg/ZODB/serialize.py", line 664, in referencesf assert isinstance(reference, list) AssertionError because the reference was None. zodbpickle 2 changed to make zodbpickle.binary implemented in C, which was failing earlier, because pickle.Pickle can not pickle these objects, failing in an error like this: lib/python2.7/copy_reg.py", line 70, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle binary objects This change also simplify our own implementation, by dropping jython support and calling save_dict on the super class instead of copying the implementation. Further references: - minimal script to reproduce the issues: ```python from __future__ import print_function import io import pickle import zodbpickle import zodbpickle.pickle import zodbpickle.fastpickle class ExternalObject(object): def __init__(self, oid): self.oid = oid def persistent_id(obj): if isinstance(obj, ExternalObject): return obj.oid def persistent_load(persid): print('persistent_load called with persid', repr(persid)) o = ExternalObject(oid=zodbpickle.binary("binary persid")) for pickler_class in pickle.Pickler, zodbpickle.pickle.Pickler: f = io.BytesIO() p = pickler_class(f, 1) p.persistent_id = persistent_id p.dump(o) print('dump with pickler %s:\n %r' % (pickler_class, f.getvalue())) # ZODB uses this unpickler up = zodbpickle.fastpickle.Unpickler(io.BytesIO(f.getvalue())) up.persistent_load = persistent_load up.noload() ``` ```console $ python2 repro.py # with zodbpickle 1 dump with pickler pickle.Pickler: 'ccopy_reg\n_reconstructor\nq\x00(czodbpickle\nbinary\nq\x01c__builtin__\nstr\nq\x02U\rbinary persidq\x03tq\x04Rq\x05Q.' persistent_load called with persid None dump with pickler zodbpickle.pickle_2.Pickler: 'U\rbinary persidq\x00Q.' persistent_load called with persid 'binary persid' ``` ```console $ python2 repro.py # with zodbpickle 2 Traceback (most recent call last): File "repro.py", line 45, in <module> p.dump(o) File ".../lib/python2.7/pickle.py", line 224, in dump self.save(obj) File ".../lib/python2.7/pickle.py", line 273, in save self.save_pers(pid) File ".../lib/python2.7/pickle.py", line 340, in save_pers self.save(pid) File ".../lib/python2.7/pickle.py", line 306, in save rv = reduce(self.proto) File ".../lib/python2.7/copy_reg.py", line 70, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle binary objects ``` * ZODB change starting to use zodbpickle.binary instead of str: 12ee41c4 (-ZODB now uses pickle protocol 3 for both Python 2 and Python 3., 2018-03-26) Since of 5.4.0 release * zodbpickle change starting to use C objects for zodbpickle.binary: bbef98c (Implement zodbpickle.binary in C for Py27., 2019-11-12) Since of 2.0.0 release
-
Jérome Perrin authored
Now that we fail immediately in case of failure, the deadline can be safely increased, because it only protects against kind of infinite loops. Increasing the delay should fix RuntimeError: tic is looping forever errors with only messages in status -1, that we sometimes saw on testnodes.
-
Jérome Perrin authored
Now that tic retries until the deadline is reached or all messages has failed, it can lead to situations where developer have to wait until the deadline, when a message failed but other messages (typically scheduled to run after the failed message) were still running. By stopping as soon as one message is failed, in this scenario the developer does not need to wait until the deadline.
-
Jérome Perrin authored
-
- 07 Feb, 2022 1 commit
-
-
Xiaowu Zhang authored
1. don't manipulate data base to avoid resend to web service in case of data base conflict 2. use existing property 3. change alarm frequency
-
- 04 Feb, 2022 1 commit
-
-
Vincent Pelletier authored
In our use, waitress is embedded in Zope and not as a proxy, so it has no legitimacy emitting Via headers. While this process often is the origin server, Server response header is optional and should be left to the lower layers to control, and not auto-generated by waitress.
-
- 03 Feb, 2022 4 commits
-
-
Xiaowu Zhang authored
See merge request !1500
-
Xiaowu Zhang authored
1. display employee number 2. add preview 3. add parameter to send to maileva
-
Xiaowu Zhang authored
maileva
-
Xiaowu Zhang authored
-
- 02 Feb, 2022 1 commit
-
-
Roque authored
-