summaryrefslogtreecommitdiff
path: root/test/aaa_profiling/test_memusage.py
Commit message (Collapse)AuthorAgeFilesLines
* Add SQL Server CI coverageMike Bayer2017-08-311-1/+1
| | | | Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
* Isolate memory tests in forksMike Bayer2017-08-141-28/+83
| | | | | | | | | | | | Swing the biggest hammer, run multiprocessing.Process() for each memusage test individually so that they are fully isolated from the parent process and any side effects of pytest-xdist Also add --nomemory as a shortcut to exclude_tags=memory-intensive and add this to the setup.py test runner as the memory tests should not be running for quick runs Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
* - try adding the prints back in and re-testMike Bayer2017-08-111-8/+8
| | | | Change-Id: I3a82b06ecc3c065240cc05871dee2881f20e414e
* - take more print statements out, maybe this is notMike Bayer2017-08-101-8/+8
| | | | | | | | the issue - unblock pytest-xdist now that the upstream issue is fixed, maybe this old version is the issue Change-Id: I28dd7ae0872948a188651d42e2f4af60bcbafe81
* - dont print samples, this appears like it may beMike Bayer2017-08-081-1/+6
| | | | | | itself causing the memory leak in conjunction with pytest-xdist Change-Id: Ia8704e54186e6dd60ea0e32a246fcf1419686663
* - allow the shrink phase for memusage to go until zeroed,Mike Bayer2017-08-081-3/+12
| | | | | | | some MySQL-env element is causing memory growth that goes very far before stopping Change-Id: Ic0882dd78636067980fceba4e3a969de78d5b26a
* Use baked lazyloading by defaultMike Bayer2017-04-131-1/+2
| | | | | | | | | | | | | The ``lazy="select"`` loader strategy now makes used of the :class:`.BakedQuery` query caching system in all cases. This removes most overhead of generating a :class:`.Query` object and running it into a :func:`.select` and then string SQL statement from the process of lazy-loading related collections and objects. The "baked" lazy loader has also been improved such that it can now cache in most cases where query load options are used. Change-Id: Ic96792fffaa045ae9aa0a4657d6d29235d3efb85 Fixes: #3954
* - try one more test, then we're likely going to give up on cx_OracleMike Bayer2017-04-121-29/+30
| | | | Change-Id: I7f9a1265664b0368ee7a771d01c7ca1612156d1f
* - move a few memusage tests out of "backend". something is up w/ cx_OracleMike Bayer2017-04-121-30/+35
| | | | | | | when the suite runs, such as a background thread or something like that, which is affecting these tests a bit. Change-Id: I52d50a44778ec1eecb8e335ae59b1a4773e80a79
* Warn on _compiled_cache growthMike Bayer2017-04-121-29/+25
| | | | | | | | | | | | | | | | | Added warnings to the LRU "compiled cache" used by the :class:`.Mapper` (and ultimately will be for other ORM-based LRU caches) such that when the cache starts hitting its size limits, the application will emit a warning that this is a performance-degrading situation that may require attention. The LRU caches can reach their size limits primarily if an application is making use of an unbounded number of :class:`.Engine` objects, which is an antipattern. Otherwise, this may suggest an issue that should be brought to the SQLAlchemy developer's attention. Additionally, adjusted the test_memusage algorithm again as the previous one could still allow a growing memory size to be missed. Change-Id: I020d1ceafb7a08f6addfa990a1e7acd09f933240
* Don't cache savepoint identifiersMike Bayer2017-03-061-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug in compiler where the string identifier of a savepoint would be cached in the identifier quoting dictionary; as these identifiers are arbitrary, a small memory leak could occur if a single :class:`.Connection` had an unbounded number of savepoints used, as well as if the savepoint clause constructs were used directly with an unbounded umber of savepoint names. The memory leak does **not** impact the vast majority of cases as normally the :class:`.Connection`, which renders savepoint names with a simple counter starting at "1", is used on a per-transaction or per-fixed-number-of-transactions basis before being discarded. The savepoint name in virtually all cases does not require quoting at all, however to support potential third party use cases the "check for quotes needed" logic is retained, at a small performance cost. Uncondtionally quoting the name is another option, but this would turn the name into a case sensitive name which runs the risk of poor interactions with existing deployments that may be looking at these names in other contexts. Change-Id: I6b53c96abf7fdf1840592bbca5da81347911844c Fixes: #3931
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-2/+2
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* Deprecate Mapper.order_byMike Bayer2016-04-191-5/+3
| | | | | | | | | | | This is an old parameter no longer relevant to how SQLAlchemy works, once the Query object was introduced. By deprecating it we establish that we aren't supporting non-working use cases and that we encourage applications to move off of the use of this parameter. Fixes: #3394 Change-Id: I25b9a38142a1537bbcb27d3e8b66a8b265140072
* - Fixed a leak which would occur in the unsupported and highlyMike Bayer2014-11-131-0/+26
| | | | | | | | | non-recommended use case of replacing a relationship on a fixed mapped class many times, referring to an arbitrarily growing number of target mappers. A warning is emitted when the old relationship is replaced, however if the mapping were already used for querying, the old relationship would still be referenced within some registries. fixes #3251
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | constructs are now importable from the "from sqlalchemy" namespace, just like every other Core construct. - The implicit conversion of strings to :func:`.text` constructs when passed to most builder methods of :func:`.select` as well as :class:`.Query` now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the "label reference" methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled. fixes #2992
* - A new style of warning can be emitted which will "filter" up toMike Bayer2014-08-311-0/+14
| | | | | | | | | N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
* - turn off the testing reaper here, that's the source of the leaksMike Bayer2014-08-081-12/+14
| | | | | when we are running with pydist, and even when we are running without it in fact...
* - add support for tags, including include/exclude support.Mike Bayer2014-07-271-0/+1
| | | | simplify tox again now that we can exclude tests more easily
* - fully flake8 test/aaa_profilingMike Bayer2014-07-091-110/+139
|
* Documentation fix-up: "its" vs. "it's"pr/91Matthias Urlichs2014-05-111-1/+1
| | | | | | | | | Removed ungrammatical apostrophes from documentation, replacing "it's" with "its" where appropriate (but in a few cases with "it is" when that read better). While doing that, I also fixed a couple of minor typos etc. as I noticed them.
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-2/+2
| | | | Found using: https://github.com/intgr/topy
* use integer division hereMike Bayer2014-03-261-1/+1
|
* - rework memusage tests so that it only runs five iterations at a time, if ↵Mike Bayer2014-03-261-29/+47
| | | | | | it sees success within that period, it's done. memusage tests have become very slow
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-0/+1
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* Improved support for the cymysql driver, supporting version 0.6.5,Mike Bayer2013-08-171-1/+2
| | | | courtesy Hajime Nakagami.
* - Removal of event listeners is now implemented. The feature isMike Bayer2013-07-261-0/+1
| | | | | | | | | | | | | | | | provided via the :func:`.event.remove` function. [ticket:2268] - reorganization of event.py module into a package; with the addition of the docstring work as well as the new registry for removal, there's a lot more code now. the package separates concerns and provides a top-level doc for each subsection of functionality - the remove feature works by providing the EventKey object which associates the user-provided arguments to listen() with a global, weak-referencing registry. This registry stores a collection of _ListenerCollection and _DispatchDescriptor objects associated with each set of arguments, as well as the wrapped function which was applied to that collection. The EventKey can then be recreated for a removal, all the _ListenerCollection and _DispatchDescriptor objects are located, and the correct wrapped function is removed from each one.
* - the raw 2to3 runMike Bayer2013-04-271-1/+1
| | | | - went through examples/ and cleaned out excess list() calls
* testing.crashes on cymysql >= 0.6Hajime Nakagami2013-04-201-1/+1
|
* skip with cymysql 0.6Hajime Nakagami2013-04-201-0/+1
|
* - remove all compat items that are pre-2.5 (hooray)Mike Bayer2013-03-091-1/+1
| | | | | | - other cleanup - don't need compat.decimal, that approach never panned out. hopefully outside libs aren't pulling it in, they shouldn't be
* - add workaround for sqlite memusage tests, so no longer need to count to ↵Mike Bayer2013-01-121-11/+26
| | | | | | | | | | | | | 220/skip tests - Fixed potential memory leak which could occur if an arbitrary number of :class:`.sessionmaker` objects were created. The anonymous subclass created by the sessionmaker, when dereferenced, would not be garbage collected due to remaining class-level references from the event package. This issue also applies to any custom system that made use of ad-hoc subclasses in conjunction with an event dispatcher. Also in 0.7.10. [ticket:2650]
* - refactor of pathing mechanics, to address #2614, #2617Mike Bayer2012-12-011-2/+4
| | | | | | | | | | | | | | | | | | | - paths now store Mapper + MapperProperty now instead of string key, so that the parent mapper for the property is known, supports same-named properties on multiple subclasses - the Mapper within the path is now always relevant to the property to the right of it. PathRegistry does the translation now, instead of having all the outside users of PathRegistry worry about it, to produce a path that is much more consistent. Paths are now consistent with mappings in all cases. Special logic to get at "with_polymorphic" structures and such added also. - AliasedClass now has two modes, "use_mapper_path" and regular; "use_mapper_path" is for all those situations where we put an AliasedClass in for a plain class internally, and want it to "path" with the plain mapper. - The AliasedInsp is now the first class "entity" for an AliasedClass, and is passed around internally and used as attr._parententity and such. it is the AliasedClass analogue for Mapper.
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-5/+6
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* -whitespace bonanza, contdMike Bayer2012-07-281-2/+2
|
* - [feature] The of_type() construct on attributesMike Bayer2012-06-201-46/+112
| | | | | | | | | | | | | | | | | | | | | | | | now accepts aliased() class constructs as well as with_polymorphic constructs, and works with query.join(), any(), has(), and also eager loaders subqueryload(), joinedload(), contains_eager() [ticket:2438] [ticket:1106] - a rewrite of the query path system to use an object based approach for more succinct usage. the system has been designed carefully to not add an excessive method overhead. - [feature] select() features a correlate_except() method, auto correlates all selectables except those passed. Is needed here for the updated any()/has() functionality. - remove some old cruft from LoaderStrategy, init(),debug_callable() - use a namedtuple for _extended_entity_info. This method should become standard within the orm internals - some tweaks to the memory profile tests, number of runs can be customized to work around pysqlite's very annoying behavior - try to simplify PropertyOption._get_paths(), rename to _process_paths(), returns a single list now. overall works more completely as was needed for of_type() functionality
* - [removed] The legacy "mutable" system of theMike Bayer2012-04-231-48/+0
| | | | | | | | | | | | | | ORM, including the MutableType class as well as the mutable=True flag on PickleType and postgresql.ARRAY has been removed. In-place mutations are detected by the ORM using the sqlalchemy.ext.mutable extension, introduced in 0.7. The removal of MutableType and associated constructs removes a great deal of complexity from SQLAlchemy's internals. The approach performed poorly as it would incur a scan of the full contents of the Session when in use. [ticket:2442]
* - [bug] Fixed memory leak in core which wouldMike Bayer2012-03-101-0/+16
| | | | | | | occur when C extensions were used with particular types of result fetches, in particular when orm query.count() were called. [ticket:2427]
* - this helps oracle here since it has a panic attack otherwiseMike Bayer2011-04-251-1/+2
|
* mark all aaa_profiling tests with __requires__ = 'cpython',Mike Bayer2011-04-231-6/+2
|
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-7/+7
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - whitespace removal bonanzaMike Bayer2011-01-021-32/+32
|
* triple check that the dict is emptyMike Bayer2010-12-191-2/+5
|
* - system to cache the bind/result processors in a dialect-wide registry.Mike Bayer2010-12-131-1/+27
| | | | its an idea with pointy edges.
* - support for cdecimalMike Bayer2010-12-111-2/+2
| | | | | | | | | | | | | | | | | | - add --with-cdecimal flag to tests, monkeypatches cdecimal in - fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion routines - pyodbc version 2.1.8 is needed for cdecimal in any case as previous versions also called '_int', 2.1.8 adds the same string logic as our own dialect, so that logic is skipped for modern pyodbc version - make the imports for "Decimal" consistent across the whole lib. not sure yet how we should be importing "Decimal" or what the best way forward is that would allow a clean user-invoked swap of cdecimal; for now, added docs suggesting a global monkeypatch - the two decimal libs are not compatible with each other so any chance of mixing produces serious issues. adding adapters to DBAPIs tedious and adds in-python overhead. suggestions welcome on how we should be doing Decimal/cdecimal.
* - merge default tipMike Bayer2010-12-051-1/+26
|\
| * fixed a small potential memory leak in UnicodeResultProcessor (for some weirdGaëtan de Menten2010-11-271-1/+11
| | | | | | | | | | reason, it didn't actually leak in my tests) by providing a dealloc method to the type, and added a test to ensure it stays that way. Closes #1981.
| * Remove unused import.Taavi Burns2010-11-201-1/+1
| |
| * DecimalResultProcessor memory testing is likely to catch something only when ↵Taavi Burns2010-11-201-0/+2
| | | | | | | | cextensions are enabled. [ticket:1978]
| * Shorter tests for [ticket:1978]Taavi Burns2010-11-191-33/+6
| |
| * Fix memory leaks in the cprocessors DecimalResultProcessor, including tests. ↵Taavi Burns2010-11-191-1/+41
| | | | | | | | [ticket:1978]