Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
142289d1
Commit
142289d1
authored
Mar 11, 2005
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert some XXXs. More to come.
parent
183162af
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
95 additions
and
106 deletions
+95
-106
NEWS.txt
NEWS.txt
+3
-4
src/BTrees/Maintainer.txt
src/BTrees/Maintainer.txt
+1
-1
src/BTrees/MergeTemplate.c
src/BTrees/MergeTemplate.c
+4
-4
src/BTrees/tests/testBTrees.py
src/BTrees/tests/testBTrees.py
+8
-8
src/BTrees/tests/test_btreesubclass.py
src/BTrees/tests/test_btreesubclass.py
+4
-4
src/Persistence/tests/testPersistent.py
src/Persistence/tests/testPersistent.py
+1
-1
src/ThreadedAsync/LoopCallback.py
src/ThreadedAsync/LoopCallback.py
+0
-1
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+5
-5
src/ZEO/monitor.py
src/ZEO/monitor.py
+0
-1
src/ZEO/runzeo.py
src/ZEO/runzeo.py
+5
-5
src/ZEO/tests/InvalidationTests.py
src/ZEO/tests/InvalidationTests.py
+2
-2
src/ZEO/tests/multi.py
src/ZEO/tests/multi.py
+2
-2
src/ZEO/tests/stress.py
src/ZEO/tests/stress.py
+1
-1
src/ZEO/tests/testMonitor.py
src/ZEO/tests/testMonitor.py
+2
-2
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+3
-7
src/ZEO/tests/test_cache.py
src/ZEO/tests/test_cache.py
+1
-1
src/ZEO/zrpc/marshal.py
src/ZEO/zrpc/marshal.py
+1
-1
src/ZEO/zrpc/smac.py
src/ZEO/zrpc/smac.py
+2
-2
src/ZODB/POSException.py
src/ZODB/POSException.py
+1
-1
src/ZODB/interfaces.py
src/ZODB/interfaces.py
+1
-1
src/ZODB/serialize.py
src/ZODB/serialize.py
+2
-2
src/ZODB/tests/IteratorStorage.py
src/ZODB/tests/IteratorStorage.py
+3
-1
src/ZODB/tests/MTStorage.py
src/ZODB/tests/MTStorage.py
+1
-1
src/ZODB/tests/ReadOnlyStorage.py
src/ZODB/tests/ReadOnlyStorage.py
+1
-1
src/ZODB/tests/RevisionStorage.py
src/ZODB/tests/RevisionStorage.py
+2
-2
src/ZODB/tests/StorageTestBase.py
src/ZODB/tests/StorageTestBase.py
+3
-3
src/ZODB/tests/Synchronization.py
src/ZODB/tests/Synchronization.py
+1
-1
src/ZODB/tests/testCache.py
src/ZODB/tests/testCache.py
+6
-7
src/ZODB/tests/testConnection.py
src/ZODB/tests/testConnection.py
+2
-2
src/ZODB/tests/testDB.py
src/ZODB/tests/testDB.py
+1
-1
src/ZODB/tests/testDemoStorage.py
src/ZODB/tests/testDemoStorage.py
+2
-2
src/ZODB/tests/testTimeStamp.py
src/ZODB/tests/testTimeStamp.py
+1
-1
src/ZODB/tests/test_datamanageradapter.py
src/ZODB/tests/test_datamanageradapter.py
+1
-2
src/ZODB/tests/testmvcc.py
src/ZODB/tests/testmvcc.py
+1
-1
src/persistent/interfaces.py
src/persistent/interfaces.py
+1
-1
src/persistent/tests/persistenttestbase.py
src/persistent/tests/persistenttestbase.py
+6
-6
src/persistent/tests/testPersistent.py
src/persistent/tests/testPersistent.py
+1
-1
src/scripts/manual_tests/testfstest.py
src/scripts/manual_tests/testfstest.py
+1
-2
src/scripts/manual_tests/testzeopack.py
src/scripts/manual_tests/testzeopack.py
+2
-2
src/scripts/netspace.py
src/scripts/netspace.py
+2
-2
src/scripts/repozo.py
src/scripts/repozo.py
+0
-3
src/transaction/interfaces.py
src/transaction/interfaces.py
+3
-3
test.py
test.py
+5
-5
No files found.
NEWS.txt
View file @
142289d1
...
...
@@ -813,8 +813,7 @@ earlier names:
The in-memory, per-connection object cache (pickle cache) was changed
to participate in garbage collection. This should reduce the number
of memory leaks, although we are still tracking a few problems. [XXX
might say more here]
of memory leaks, although we are still tracking a few problems.
Multi-version concurrency control
---------------------------------
...
...
@@ -1362,7 +1361,7 @@ The ZEO cache verification protocol was revised to require many fewer
messages in cases where a client or server restarts quickly.
The performance of full cache verification has improved dramatically.
XXX Get measurements from Jim -- somewhere in 2x-5x recall
. The
Measurements from Jim were somewhere in 2x-5x
. The
implementation was fixed to use the very-fast getSerial() method on
the storage instead of the comparatively slow load().
...
...
@@ -1720,7 +1719,7 @@ The ZEO version number was bumped to 2.0.2 on account of the following
minor feature additions.
The performance of full cache verification has improved dramatically.
XXX Get measurements from Jim -- somewhere in 2x-5x recall
. The
Measurements from Jim were somewhere in 2x-5x
. The
implementation was fixed to use the very-fast getSerial() method on
the storage instead of the comparatively slow load().
...
...
src/BTrees/Maintainer.txt
View file @
142289d1
...
...
@@ -96,7 +96,7 @@ type VALUE_TYPE. The macro returns an int, with value
< 0 if X < Y
== 0 if X == Y
> 0 if X > Y
XXX
There is no provision for determining whether the comparison
Bug:
There is no provision for determining whether the comparison
attempt failed (set a Python exception).
DECREF_VALUE(K)
...
...
src/BTrees/MergeTemplate.c
View file @
142289d1
...
...
@@ -79,9 +79,9 @@ merge_error(int p1, int p2, int p3, int reason)
* Mapping value modification: s2 or s3 can modify the value associated
* with a key in s1, provided the other transaction doesn't make a
* modification of the same key to a different value. It's OK if s2 and s3
* both give the same new value to the key
(XXX while it's hard to be
*
precise about why, this doesn't seem consistent with that it's *not* OK
*
for both to add
a new key mapping to the same value).
* both give the same new value to the key
while it's hard to be precise about
*
why, this doesn't seem consistent with that it's *not* OK for both to add
* a new key mapping to the same value).
*/
static
PyObject
*
bucket_merge
(
Bucket
*
s1
,
Bucket
*
s2
,
Bucket
*
s3
)
...
...
@@ -118,7 +118,7 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
/* Consult zodb/btrees/interfaces.py for the meaning of the last
* argument passed to merge_error().
*/
/*
XXX
This isn't passing on errors raised by value comparisons. */
/*
TODO:
This isn't passing on errors raised by value comparisons. */
while
(
i1
.
position
>=
0
&&
i2
.
position
>=
0
&&
i3
.
position
>=
0
)
{
TEST_KEY_SET_OR
(
cmp12
,
i1
.
key
,
i2
.
key
)
goto
err
;
...
...
src/BTrees/tests/testBTrees.py
View file @
142289d1
...
...
@@ -39,12 +39,12 @@ class Base(TestCase):
def
_getRoot
(
self
):
if
self
.
db
is
None
:
#
XXX
On the next line, the ZODB4 flavor of this routine
#
XXX p
asses a cache_size argument:
#
Unclear:
On the next line, the ZODB4 flavor of this routine
#
[
asses a cache_size argument:
# self.db = DB(MappingStorage(), cache_size=1)
#
XXX
If that's done here, though, testLoadAndStore() and
#
XXX
testGhostUnghost() both nail the CPU and seemingly
#
XXX
never finish.
# If that's done here, though, testLoadAndStore() and
# testGhostUnghost() both nail the CPU and seemingly
# never finish.
self
.
db
=
DB
(
MappingStorage
())
return
self
.
db
.
open
().
root
()
...
...
@@ -138,9 +138,9 @@ class MappingBase(Base):
for
i
in
range
(
1000
):
self
.
t
[
i
]
=
i
r
=
repr
(
self
.
t
)
#
make sure the repr is 10000 bytes long for a bucket
#
XXX since w
e the test is also run for btrees, skip the length
#
XXX
check if the repr starts with '<'
#
Make sure the repr is 10000 bytes long for a bucket.
#
But sinc
e the test is also run for btrees, skip the length
# check if the repr starts with '<'
if
not
r
.
startswith
(
'<'
):
self
.
assert_
(
len
(
r
)
>
10000
)
...
...
src/BTrees/tests/test_btreesubclass.py
View file @
142289d1
...
...
@@ -28,10 +28,10 @@ class SubclassTest(unittest.TestCase):
# of that type
t
=
T
()
#
XXX t
here's no good way to get a bucket at the moment.
#
XXX
__getstate__() is as good as it gets, but the default
#
XXX
getstate explicitly includes the pickle of the bucket
#
XXX
for small trees, so we have to be clever :-(
#
T
here's no good way to get a bucket at the moment.
# __getstate__() is as good as it gets, but the default
# getstate explicitly includes the pickle of the bucket
# for small trees, so we have to be clever :-(
# make sure there is more than one bucket in the tree
for
i
in
range
(
1000
):
...
...
src/Persistence/tests/testPersistent.py
View file @
142289d1
...
...
@@ -216,7 +216,7 @@ class PersistenceTest(unittest.TestCase):
self
.
assertEqual
(
obj
.
curly
,
2
)
self
.
assertEqual
(
obj
.
moe
,
3
)
#
XXX
Need to decide how __setattr__ and __delattr__ should work,
#
TODO:
Need to decide how __setattr__ and __delattr__ should work,
# then write tests.
...
...
src/ThreadedAsync/LoopCallback.py
View file @
142289d1
...
...
@@ -189,5 +189,4 @@ def loop(timeout=30.0, use_poll=0, map=None):
##asyncore.loop = deprecated_loop
# XXX Remove this once we've updated ZODB4 since they share this package
asyncore
.
loop
=
loop
src/ZEO/StorageServer.py
View file @
142289d1
...
...
@@ -16,7 +16,7 @@
This server acts as a front-end for one or more real storages, like
file storage or Berkeley storage.
XXX
Need some basic access control-- a declaration of the methods
TODO:
Need some basic access control-- a declaration of the methods
exported for invocation by the server.
"""
...
...
@@ -47,8 +47,8 @@ from ZODB.loglevels import BLATHER
logger
=
logging
.
getLogger
(
'ZEO.StorageServer'
)
#
XXX This used to say "ZSS", which is now implied in the logger name, can this
#
be either set to str(os.getpid()) (if that makes sense) or removed?
#
TODO: This used to say "ZSS", which is now implied in the logger name.
#
Can this
be either set to str(os.getpid()) (if that makes sense) or removed?
_label
=
""
# default label used for logging.
def
set_label
():
...
...
@@ -298,7 +298,7 @@ class ZEOStorage:
os
=
self
.
storage
.
getTid
(
oid
)
except
KeyError
:
self
.
client
.
invalidateVerify
((
oid
,
''
))
#
XXX
It's not clear what we should do now. The KeyError
# It's not clear what we should do now. The KeyError
# could be caused by an object uncreation, in which case
# invalidation is right. It could be an application bug
# that left a dangling reference, in which case it's bad.
...
...
@@ -564,7 +564,7 @@ class ZEOStorage:
# finishes as a transaction and finds another instance is in the
# _waiting list.
#
XXX
It might be better to have a mechanism to explicitly send
# It might be better to have a mechanism to explicitly send
# the finishing transaction's reply before restarting the waiting
# transaction. If the restart takes a long time, the previous
# client will be blocked until it finishes.
...
...
src/ZEO/monitor.py
View file @
142289d1
...
...
@@ -103,7 +103,6 @@ class StatsClient(asyncore.dispatcher):
return
len
(
self
.
buf
)
def
readable
(
self
):
# XXX what goes here?
return
0
def
handle_write
(
self
):
...
...
src/ZEO/runzeo.py
View file @
142289d1
...
...
@@ -52,7 +52,7 @@ def log(msg, level=logging.INFO, exc_info=False):
def
parse_address
(
arg
):
#
XXX Not part of the official ZConfig API
#
Caution: Not part of the official ZConfig API.
obj
=
ZConfig
.
datatypes
.
SocketAddress
(
arg
)
return
obj
.
family
,
obj
.
address
...
...
@@ -203,7 +203,7 @@ class ZEOServer:
transaction_timeout
=
self
.
options
.
transaction_timeout
,
monitor_address
=
self
.
options
.
monitor_address
,
auth_protocol
=
self
.
options
.
auth_protocol
,
auth_database
=
self
.
options
.
auth_database
,
# XXX option spelling
auth_database
=
self
.
options
.
auth_database
,
auth_realm
=
self
.
options
.
auth_realm
)
def
loop_forever
(
self
):
...
...
@@ -223,9 +223,9 @@ class ZEOServer:
sys
.
exit
(
1
)
def
handle_sigusr2
(
self
):
#
XXX
this used to reinitialize zLOG. How do I achieve
#
the same effect with Python's logging package?
#
Should we restart as with SIGHUP?
#
TODO:
this used to reinitialize zLOG. How do I achieve
# the same effect with Python's logging package?
# Should we restart as with SIGHUP?
log
(
"received SIGUSR2, but it was not handled!"
,
level
=
logging
.
WARNING
)
def
close_storages
(
self
):
...
...
src/ZEO/tests/InvalidationTests.py
View file @
142289d1
...
...
@@ -524,8 +524,8 @@ class InvalidationTests:
db1
.
close
()
db2
.
close
()
#
XXX
Temporarily disabled. I know it fails, and there's no point
#
XXX
getting an endless number of reports about that.
#
TODO:
Temporarily disabled. I know it fails, and there's no point
# getting an endless number of reports about that.
def
xxxcheckConcurrentUpdatesInVersions
(
self
):
self
.
_storage
=
storage1
=
self
.
openClientStorage
()
db1
=
DB
(
storage1
)
...
...
src/ZEO/tests/multi.py
View file @
142289d1
...
...
@@ -12,7 +12,7 @@
#
##############################################################################
"""A multi-client test of the ZEO storage server"""
#
XXX
This code is currently broken.
#
TODO:
This code is currently broken.
import
ZODB
,
ZODB
.
DB
,
ZODB
.
FileStorage
,
ZODB
.
POSException
import
persistent
...
...
@@ -148,7 +148,7 @@ def main(client_func=None):
server
.
close
()
os
.
waitpid
(
server_pid
,
0
)
#
XXX
Should check that the results are consistent!
#
TODO:
Should check that the results are consistent!
print
"Total time:"
,
t2
-
t0
print
"Server start time"
,
t1
-
t0
...
...
src/ZEO/tests/stress.py
View file @
142289d1
...
...
@@ -16,7 +16,7 @@
The stress test should run in an infinite loop and should involve
multiple connections.
"""
#
XXX
This code is currently broken.
#
TODO:
This code is currently broken.
import
transaction
import
ZODB
...
...
src/ZEO/tests/testMonitor.py
View file @
142289d1
...
...
@@ -74,8 +74,8 @@ class MonitorTests(CommonSetupTearDown):
return
"""<mappingstorage 1/>"""
def
testMonitor
(
self
):
#
j
ust open a client to know that the server is up and running
#
XXX should put this in setUp
#
J
ust open a client to know that the server is up and running
#
TODO: should put this in setUp.
self
.
storage
=
self
.
openClientStorage
()
s
=
self
.
get_monitor_output
()
self
.
storage
.
close
()
...
...
src/ZEO/tests/testZEO.py
View file @
142289d1
...
...
@@ -87,7 +87,7 @@ def get_port():
try
:
s
.
connect
((
'localhost'
,
port
))
except
socket
.
error
:
#
XXX check value of error?
#
Perhaps we should check value of error too.
return
port
finally
:
s
.
close
()
...
...
@@ -112,7 +112,7 @@ class GenericTests(
"""Combine tests from various origins in one class."""
def
setUp
(
self
):
logger
.
info
(
"setUp() %s"
,
self
.
id
())
# XXX is this really needed?
logger
.
info
(
"setUp() %s"
,
self
.
id
())
port
=
get_port
()
zconf
=
forker
.
ZEOConfig
((
''
,
port
))
zport
,
adminaddr
,
pid
,
path
=
forker
.
start_zeo_server
(
self
.
getConfig
(),
...
...
@@ -136,7 +136,7 @@ class GenericTests(
os
.
waitpid
(
pid
,
0
)
def
open
(
self
,
read_only
=
0
):
#
XXX
Needed to support ReadOnlyStorage tests. Ought to be a
# Needed to support ReadOnlyStorage tests. Ought to be a
# cleaner way.
addr
=
self
.
_storage
.
_addr
self
.
_storage
.
close
()
...
...
@@ -201,10 +201,6 @@ class MappingStorageTests(GenericTests):
def
getConfig
(
self
):
return
"""<mappingstorage 1/>"""
# XXX There are still a bunch of tests that fail. Are there
# still test classes in GenericTests that shouldn't be there?
# XXX Is the above comment still relevant?
test_classes
=
[
FileStorageTests
,
MappingStorageTests
]
def
test_suite
():
...
...
src/ZEO/tests/test_cache.py
View file @
142289d1
...
...
@@ -123,7 +123,7 @@ class CacheTests(unittest.TestCase):
self
.
cache
.
store
(
n
,
""
,
n
,
None
,
data
[
51
])
self
.
assert_
(
len
(
self
.
cache
)
<
51
)
#
XXX
Need to make sure eviction of non-current data
#
TODO:
Need to make sure eviction of non-current data
# and of version data are handled correctly.
def
testSerialization
(
self
):
...
...
src/ZEO/zrpc/marshal.py
View file @
142289d1
...
...
@@ -72,7 +72,7 @@ def find_global(module, name):
if
safe
:
return
r
#
XXX what's a better way to do this? esp w/ 2.1 & 2.2
#
TODO: is there a better way to do this?
if
type
(
r
)
==
types
.
ClassType
and
issubclass
(
r
,
Exception
):
return
r
...
...
src/ZEO/zrpc/smac.py
View file @
142289d1
...
...
@@ -133,7 +133,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
def
get_addr
(
self
):
return
self
.
addr
#
XXX
avoid expensive getattr calls? Can't remember exactly what
#
TODO:
avoid expensive getattr calls? Can't remember exactly what
# this comment was supposed to mean, but it has something to do
# with the way asyncore uses getattr and uses if sock:
def
__nonzero__
(
self
):
...
...
@@ -193,7 +193,7 @@ class SizedMessageAsyncConnection(asyncore.dispatcher):
else
:
msg_size
=
4
state
=
0
#
XXX
We call message_input() with __input_lock
#
Obscure:
We call message_input() with __input_lock
# held!!! And message_input() may end up calling
# message_output(), which has its own lock. But
# message_output() cannot call message_input(), so
...
...
src/ZODB/POSException.py
View file @
142289d1
...
...
@@ -292,7 +292,7 @@ class InvalidObjectReference(POSError):
o A reference to an object in a different database connection.
XXX
The exception ought to have a member that is the invalid object.
TODO:
The exception ought to have a member that is the invalid object.
"""
class
ConnectionStateError
(
POSError
):
...
...
src/ZODB/interfaces.py
View file @
142289d1
...
...
@@ -21,7 +21,7 @@ import zope.interface
class
IConnection
(
zope
.
interface
.
Interface
):
"""ZODB connection.
XXX
: This interface is incomplete.
TODO
: This interface is incomplete.
"""
def
add
(
ob
):
...
...
src/ZODB/serialize.py
View file @
142289d1
...
...
@@ -454,7 +454,7 @@ class ConnectionObjectReader(BaseObjectReader):
# to create the instance w/o hitting the db, so go for it!
oid
,
klass
=
oid
obj
=
self
.
_cache
.
get
(
oid
,
None
)
# XXX it's not a dict
obj
=
self
.
_cache
.
get
(
oid
,
None
)
if
obj
is
not
None
:
return
obj
...
...
@@ -474,7 +474,7 @@ class ConnectionObjectReader(BaseObjectReader):
# current data in the object's actual record!
return
self
.
_conn
.
get
(
oid
)
#
XXX
should be done by connection
#
TODO:
should be done by connection
obj
.
_p_oid
=
oid
obj
.
_p_jar
=
self
.
_conn
# When an object is created, it is put in the UPTODATE
...
...
src/ZODB/tests/IteratorStorage.py
View file @
142289d1
...
...
@@ -127,12 +127,14 @@ class IteratorStorage(IteratorCompare):
self
.
assertEqual
(
count
,
1
)
def
checkIterationIntraTransaction
(
self
):
# XXX try this test with logging enabled. If you see something like
# TODO: Try this test with logging enabled. If you see something
# like
#
# ZODB FS FS21 warn: FileStorageTests.fs truncated, possibly due to
# damaged records at 4
#
# Then the code in FileIterator.next() hasn't yet been fixed.
# Should automate that check.
oid
=
self
.
_storage
.
new_oid
()
t
=
Transaction
()
data
=
zodb_pickle
(
MinPO
(
0
))
...
...
src/ZODB/tests/MTStorage.py
View file @
142289d1
...
...
@@ -188,7 +188,7 @@ class ExtStorageClientThread(StorageClientThread):
try
:
iter
=
self
.
storage
.
iterator
()
except
AttributeError
:
#
XXX
It's hard to detect that a ZEO ClientStorage
# It's hard to detect that a ZEO ClientStorage
# doesn't have this method, but does have all the others.
return
for
obj
in
iter
:
...
...
src/ZODB/tests/ReadOnlyStorage.py
View file @
142289d1
...
...
@@ -32,7 +32,7 @@ class ReadOnlyStorage:
def
checkReadMethods
(
self
):
self
.
_create_data
()
self
.
_make_readonly
()
#
XXX not going to bother checking all read methods
#
Note that this doesn't check _all_ read methods.
for
oid
in
self
.
oids
.
keys
():
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
self
.
assertEqual
(
revid
,
self
.
oids
[
oid
])
...
...
src/ZODB/tests/RevisionStorage.py
View file @
142289d1
...
...
@@ -107,7 +107,7 @@ class RevisionStorage:
self
.
assertEqual
(
end
,
revs
[
12
])
#
XXX
Is it okay to assume everyone testing against RevisionStorage
#
Unsure:
Is it okay to assume everyone testing against RevisionStorage
# implements undo?
def
checkLoadBeforeUndo
(
self
):
...
...
@@ -172,4 +172,4 @@ class RevisionStorage:
results
=
self
.
_storage
.
loadBefore
(
oid2
,
revid2
)
eq
(
results
,
None
)
#
XXX
There are other edge cases to handle, including pack.
#
TODO:
There are other edge cases to handle, including pack.
src/ZODB/tests/StorageTestBase.py
View file @
142289d1
...
...
@@ -80,7 +80,7 @@ def zodb_unpickle(data):
klass_info
=
u
.
load
()
if
isinstance
(
klass_info
,
types
.
TupleType
):
if
isinstance
(
klass_info
[
0
],
type
):
#
XXX
what is the second part of klass_info?
#
Unclear:
what is the second part of klass_info?
klass
,
xxx
=
klass_info
assert
not
xxx
else
:
...
...
@@ -144,7 +144,7 @@ def import_helper(name):
class
StorageTestBase
(
unittest
.
TestCase
):
#
XXX
It would be simpler if concrete tests didn't need to extend
# It would be simpler if concrete tests didn't need to extend
# setUp() and tearDown().
def
setUp
(
self
):
...
...
@@ -210,7 +210,7 @@ class StorageTestBase(unittest.TestCase):
def
_undo
(
self
,
tid
,
expected_oids
=
None
,
note
=
None
):
# Undo a tid that affects a single object (oid).
#
XXX This is very specialized
#
This is very specialized.
t
=
transaction
.
Transaction
()
t
.
note
(
note
or
"undo"
)
self
.
_storage
.
tpc_begin
(
t
)
...
...
src/ZODB/tests/Synchronization.py
View file @
142289d1
...
...
@@ -142,4 +142,4 @@ class SynchronizedStorage:
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
tpc_abort
(
t
)
#
XXX
how to check undo?
#
TODO:
how to check undo?
src/ZODB/tests/testCache.py
View file @
142289d1
...
...
@@ -107,8 +107,8 @@ class DBMethods(CacheTestBase):
for
k
,
v
in
dict
.
items
():
self
.
assert_
(
k
in
expected
)
#
XXX
not really sure how to do a black box test of the cache.
#
s
hould the full sweep and minimize calls always remove things?
#
TODO:
not really sure how to do a black box test of the cache.
#
S
hould the full sweep and minimize calls always remove things?
def
checkFullSweep
(
self
):
old_size
=
self
.
db
.
cacheSize
()
...
...
@@ -175,10 +175,9 @@ class DBMethods(CacheTestBase):
self
.
fail
(
"cacheMinimize still running after 30 seconds -- "
"almost certainly in an infinite loop"
)
# XXX don't have an explicit test for incrgc, because the
# connection and database call it internally
# XXX same for the get and invalidate methods
# TODO: don't have an explicit test for incrgc, because the
# connection and database call it internally.
# Same for the get and invalidate methods.
def
checkLRUitems
(
self
):
# get a cache
...
...
@@ -264,7 +263,7 @@ class LRUCacheTests(CacheTestBase):
gc
.
collect
()
#
XXX
The above gc.collect call is necessary to make this test
#
Obscure:
The above gc.collect call is necessary to make this test
# pass.
#
# This test then only works because the order of computations
...
...
src/ZODB/tests/testConnection.py
View file @
142289d1
...
...
@@ -142,10 +142,10 @@ class ConnectionDotAdd(unittest.TestCase):
class
UserMethodTests
(
unittest
.
TestCase
):
#
XXX
add isn't tested here, because there are a bunch of traditional
# add isn't tested here, because there are a bunch of traditional
# unit tests for it.
#
XXX t
he version tests would require a storage that supports versions
#
T
he version tests would require a storage that supports versions
# which is a bit more work.
def
test_root
(
self
):
...
...
src/ZODB/tests/testDB.py
View file @
142289d1
...
...
@@ -60,7 +60,7 @@ class DBTests(unittest.TestCase):
self
.
db
.
setCacheDeactivateAfter
,
12
)
self
.
assertRaises
(
DeprecationWarning
,
self
.
db
.
setVersionCacheDeactivateAfter
,
12
)
#
XXX
There is no API call for removing the warning we just
#
Obscure:
There is no API call for removing the warning we just
# added, but filters appears to be a public variable.
del
warnings
.
filters
[
0
]
self
.
db
.
setCacheSize
(
15
)
...
...
src/ZODB/tests/testDemoStorage.py
View file @
142289d1
...
...
@@ -36,11 +36,11 @@ class DemoStorageTests(StorageTestBase.StorageTestBase,
pass
def
checkAbortVersionNonCurrent
(
self
):
#
XXX
Need to implement a real loadBefore for DemoStorage?
#
TODO:
Need to implement a real loadBefore for DemoStorage?
pass
def
checkLoadBeforeVersion
(
self
):
#
XXX
Need to implement a real loadBefore for DemoStorage?
#
TODO:
Need to implement a real loadBefore for DemoStorage?
pass
# the next three pack tests depend on undo
...
...
src/ZODB/tests/testTimeStamp.py
View file @
142289d1
...
...
@@ -104,7 +104,7 @@ class TimeStampTests(unittest.TestCase):
ts2
=
ts
.
laterThan
(
ts
)
self
.
assert_
(
ts2
>
ts
)
#
XXX
should test for bogus inputs to TimeStamp constructor
#
TODO:
should test for bogus inputs to TimeStamp constructor
def
checkTimeStamp
(
self
):
# Alternate test suite
...
...
src/ZODB/tests/test_datamanageradapter.py
View file @
142289d1
...
...
@@ -11,8 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""XXX short summary goes here.
"""
$Id$
"""
import
unittest
...
...
src/ZODB/tests/testmvcc.py
View file @
142289d1
...
...
@@ -89,7 +89,7 @@ monotonically increasing, so the first one seen during the current
transaction remains the high-water mark for the duration of the
transaction.
XXX
We'd like simple abort and commit calls to make txn boundaries,
We'd like simple abort and commit calls to make txn boundaries,
but that doesn't work unless an object is modified. sync() will abort
a transaction and process invalidations.
...
...
src/persistent/interfaces.py
View file @
142289d1
...
...
@@ -245,7 +245,7 @@ class IPersistentNoReadConflicts(IPersistent):
conflicts for this object.
"""
#
XXX
TODO: document conflict resolution.
# TODO: document conflict resolution.
class
IPersistentDataManager
(
Interface
):
"""Provide services for managing persistent state.
...
...
src/persistent/tests/persistenttestbase.py
View file @
142289d1
...
...
@@ -47,7 +47,7 @@ class Test(unittest.TestCase):
self
.
assertEqual
(
p
.
_p_changed
,
1
)
self
.
assertEqual
(
dm
.
called
,
1
)
del
p
.
_p_changed
#
XXX
deal with current cPersistence implementation
# deal with current cPersistence implementation
if
p
.
_p_changed
!=
3
:
self
.
assertEqual
(
p
.
_p_changed
,
None
)
self
.
assertEqual
(
dm
.
called
,
1
)
...
...
@@ -164,7 +164,7 @@ class Test(unittest.TestCase):
p
.
_p_jar
=
dm
p
.
_p_changed
=
0
p
.
_p_deactivate
()
#
XXX
does this really test the activate method?
#
Unsure:
does this really test the activate method?
p
.
_p_activate
()
self
.
assertEqual
(
p
.
_p_changed
,
0
)
self
.
assertEqual
(
p
.
x
,
42
)
...
...
@@ -266,10 +266,10 @@ class Test(unittest.TestCase):
self
.
assert_
(
P
.
__dictoffset__
<
P
.
__weakrefoffset__
)
self
.
assert_
(
P
.
__basicsize__
>
Persistent
.
__basicsize__
)
#
XXX Can anyone defend/explain the test below? The tests classes defined here
# don't define __call__, so this weird test will always pass, but to what
# end?
What the heck is the point. If a klass is given that happens
#
to define __call__, the test *may*
mysteriously fail. Who cares?
#
Unsure: Can anyone defend/explain the test below? The tests classes defined
#
here
don't define __call__, so this weird test will always pass, but to what
# end?
If a klass is given that happens to define __call__, the test *may*
# mysteriously fail. Who cares?
## def testDeactivateErrors(self):
## p = self.klass()
...
...
src/persistent/tests/testPersistent.py
View file @
142289d1
...
...
@@ -251,7 +251,7 @@ class PersistenceTest(unittest.TestCase):
self
.
assertEqual
(
obj
.
curly
,
2
)
self
.
assertEqual
(
obj
.
moe
,
3
)
#
XXX
Need to decide how __setattr__ and __delattr__ should work,
#
TODO:
Need to decide how __setattr__ and __delattr__ should work,
# then write tests.
...
...
src/scripts/manual_tests/testfstest.py
View file @
142289d1
"""Verify that fstest.py can find errors.
XXX
To run this test script fstest.py must be on your PYTHONPATH.
Note:
To run this test script fstest.py must be on your PYTHONPATH.
"""
from
cStringIO
import
StringIO
...
...
@@ -15,7 +15,6 @@ from fstest import FormatError, U64
class
TestCorruptedFS
(
unittest
.
TestCase
):
# XXX path?
f
=
open
(
'test-checker.fs'
,
'rb'
)
datafs
=
f
.
read
()
f
.
close
()
...
...
src/scripts/manual_tests/testzeopack.py
View file @
142289d1
...
...
@@ -13,10 +13,10 @@ import threading
import
time
import
unittest
#
XXX
The forker interface isn't clearly defined. It's different on
#
TODO:
The forker interface isn't clearly defined. It's different on
# different branches of ZEO. This will break someday.
#
XXX
Only handle the Unix variant of the forker. Just to give Tim
#
TODO:
Only handle the Unix variant of the forker. Just to give Tim
# something to do.
class
PackerTests
(
StorageTestBase
):
...
...
src/scripts/netspace.py
View file @
142289d1
...
...
@@ -20,10 +20,10 @@ def find_paths(root, maxdist):
from the root, looking for persistent objects. Return a dict
mapping oids to traversal paths.
XXX
Assumes that the keys of the root are not themselves
TODO:
Assumes that the keys of the root are not themselves
persistent objects.
XXX
Doesn't traverse containers.
TODO:
Doesn't traverse containers.
"""
paths
=
{}
...
...
src/scripts/repozo.py
View file @
142289d1
...
...
@@ -473,9 +473,6 @@ def do_backup(options):
# then perhaps the file was packed at some point (or a
# non-transactional undo was performed, but this is deprecated). Only
# do a full backup if forced to.
#
# XXX For ZODB4, this needs to take into account the storage metadata
# header that FileStorage has grown at the front of the file.
if
reposum
==
srcsum_backedup
:
log
(
'doing incremental, starting at: %s'
,
reposz
)
do_incremental_backup
(
options
,
reposz
,
repofiles
)
...
...
src/transaction/interfaces.py
View file @
142289d1
...
...
@@ -347,7 +347,7 @@ class ITransaction(zope.interface.Interface):
"The name of the user on whose behalf the transaction is being
\
n
"
"performed. The format of the user name is defined by the
\
n
"
"application."
)
#
XXX
required to be a string?
#
Unsure:
required to be a string?
description
=
zope
.
interface
.
Attribute
(
"description"
,
...
...
@@ -392,7 +392,7 @@ class ITransaction(zope.interface.Interface):
end of the description following two newline characters.
Surrounding whitespace is stripped from text.
"""
#
XXX
does impl do the right thing with ''? Not clear what
#
Unsure:
does impl do the right thing with ''? Not clear what
# the "right thing" is.
def
setUser
(
user_name
,
path
=
"/"
):
...
...
@@ -411,7 +411,7 @@ class ITransaction(zope.interface.Interface):
Storage implementations may limit the amount of extension data
which can be stored.
"""
#
XXX is th
is this allowed to cause an exception here, during
#
Unsure:
is this allowed to cause an exception here, during
# the two-phase commit, or can it toss data silently?
class
ISavePoint
(
zope
.
interface
.
Interface
):
...
...
test.py
View file @
142289d1
...
...
@@ -93,7 +93,7 @@ Test harness.
This requires that Python was built --with-pydebug.
-T
Use the trace module from Python for code coverage.
XXX
This only works
Use the trace module from Python for code coverage. This only works
if trace.py is explicitly added to PYTHONPATH. The current utility writes
coverage files to a directory named `coverage' that is parallel to
`build'. It also prints a summary to stdout.
...
...
@@ -208,8 +208,8 @@ class ImmediateTestResult(unittest._TextTestResult):
print
"The following test left garbage:"
print
test
print
gc
.
garbage
#
XXX
Perhaps eat the garbage here, so that the garbage isn't
#
printed for every subsequent test.
#
TODO:
Perhaps eat the garbage here, so that the garbage isn't
#
|
printed for every subsequent test.
def
print_times
(
self
,
stream
,
count
=
None
):
results
=
self
.
_testtimes
.
items
()
...
...
@@ -244,7 +244,7 @@ class ImmediateTestResult(unittest._TextTestResult):
if
self
.
showAll
:
self
.
stream
.
write
(
": "
)
elif
self
.
_progressWithNames
:
#
XXX will break with multibyte strings
#
TODO: will break with multibyte strings.
name
=
self
.
getShortDescription
(
test
)
width
=
len
(
name
)
if
width
<
self
.
_lastWidth
:
...
...
@@ -641,7 +641,7 @@ def configure_logging():
import
logging.config
# Get the log.ini file from the current directory instead of possibly
# buried in the build directory.
XXX
This isn't perfect because if
# buried in the build directory. This isn't perfect because if
# log.ini specifies a log file, it'll be relative to the build directory.
# Hmm...
logini
=
os
.
path
.
abspath
(
"log.ini"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment