summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAge
* Apply same workaround for other warningsChristian Mollekopf2018-08-22
|
* Workaround for warning during testChristian Mollekopf2018-08-22
|
* Separate UIDs and Revisions in main databasesRémi Nicole2018-08-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Change revision type from `qint64` to `size_t` for LMDB in a couple of places (LMDB supports `unsigned int` or `size_t` which are `long unsigned int` on my machine) - Better support for database flags (duplicate, integer keys, integer values for now but is extensible) - Main databases' keys are now revisions - Some databases switched to integer keys databases: - Main databases - the revision to uid mapping database - the revision to entity type mapping database - Refactor the entity type's `typeDatabases` method (if in the future we need to change the main databases' flags again) - New uid to revision mapping database (`uidsToRevisions`): - Stores all revisions (not uid to latest revision) because we need it for cleaning old revisions - Flags are: duplicates + integer values (so findLatest finds the latest revision for the given uid) ~~Problems to fix before merging:~~ All Fixed! - ~~Sometimes Sink can't read what has just been written to the database (maybe because of transactions race conditions)~~ - ~~Most of the times, this results in Sink not able to find the uid for a given revision by reading the `revisions` database~~ - ~~`pipelinetest`'s `testModifyWithConflict` fails because the local changes are overridden~~ ~~The first problem prevents me from running benchmarks~~ Reviewers: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D14974
* Fixed threading issues with dynamic db creation.Christian Mollekopf2018-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch addresses two problems: * A potential deadlock. We had the following code inside a separately protected section: dbiLocker.unlock(); //Here we could loos the readlock QWriteLocker dbiWriteLocker(&sDbisLock); If we lost the lock in between the two lines, the second thread that was now holding a read-lock on sDbisLock could not enter the protected section, which was a requirement to release the read-lock, and we'd thus end up in a deadlock. This is solved using tryLock with intermediate releases of the read-lock, allowing the original thread to finish. * When failing to validate a dbi for the current transacation we simply returned an invalid db (which then in this particular case broke reading of revision uid's and type's), leading to queries not executing as they should. Both problems are unfortunately hard to reproduce, the adjusted test at leaset allowed me to reproduce the deadlock situation sometimes. To fix this cleanly we should probably just get rid of dynamic dbi allocation for good.
* Cleanup.Christian Mollekopf2018-08-02
|
* Disabled flaky testChristian Mollekopf2018-07-30
|
* Debug messages and a higher limit for queriesChristian Mollekopf2018-07-27
|
* Fixed storagetestChristian Mollekopf2018-07-27
|
* New Key API in storage layerRémi Nicole2018-07-27
| | | | | | | | | | | | | | | | | Summary: - Use object oriented paradigm for Keys / Identifiers /Revisions - "Compress" keys by using byte representation of Uuids - Still some cleaning left to do - Also run some benchmarks - I'm questioning whether files other than entitystore (tests excluded) are allowed to access this API Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13735
* Better querytestChristian Mollekopf2018-07-27
|
* There isn't even a resource which we could shutdown in this testChristian Mollekopf2018-07-26
|
* This is not a reliable test, so we turn it into a warning instead.Christian Mollekopf2018-07-25
|
* No random timeouts in testsChristian Mollekopf2018-07-25
|
* Avoid the socket probing and move the shutdown logic intoChristian Mollekopf2018-07-25
| | | | | | | | | | | | | | | resourceaccess. The problem was (as excercised by the last test in resourcecontroltest), that in this scenario we would: * trigger a synchronization that starts the resource, and then goes into a loop trying to connecting (KAsync::wait -> singleshot timer) * trigger a shutdown that would probe for the socket, not find it, and thus do nothing. * exit the testfunction, which somehow stops qtimer processing, meaning we are stuck in KAsync::wait. For now this is fixed by simply not probing for the socket.
* Wait for long enough so we can time-outChristian Mollekopf2018-07-24
|
* Deal with modifications to filtered entitiesChristian Mollekopf2018-07-16
|
* test utf8Christian Mollekopf2018-07-13
|
* CleanupChristian Mollekopf2018-07-12
|
* Fixed the case when a dbi would leak through to a transaction where itChristian Mollekopf2018-07-12
| | | | | | shouldn't be visible yet. Was reproducible in the initial sync of the caldav resource.
* A little extra testingChristian Mollekopf2018-07-02
|
* Fixed yet another reduction update codepathChristian Mollekopf2018-07-02
|
* Avoid overwriting local changes with remote modifications.Christian Mollekopf2018-06-26
| | | | | | | | | | | | | | | | | | | The case we ran into is the following: * Fetching the full payload and marking all messages of a thread as read happens simultaneously. * The local modification to mark as read gets immediately overwritten when the full payload arrives. * Eventually the modification gets replayed to the server though (and the reversal isn't because coming from the source), so on next sync the situation fixes itself. To be able to improve this we try to protect local modifications in that properties that have been modified since baseRevision (which currently isn't, but should be equal to the last to the server replayed revision) are not overwritten. This conflict resolution strategy thus always prefers local modifications. baseRevision is currently set to the current maximum revision of the store at the time when the resource creates the modification.
* Fixed the lost update scenarioChristian Mollekopf2018-06-25
| | | | | | | If we get a fetchMore right between when the revision was updated and the incrementalQuery actually running, we ended up loosing the update because the result provider ended up with a too recent revision after the additional initial query.
* Fixed the thread index.Christian Mollekopf2018-06-19
| | | | | | | | * Modifications could result in index changes because we lost the threadId due to remove + add. A modify was necessary (although we can ignore it for the email case). * The ThreadIndexer would try to lookup and potentially index threads for empty parent ids, which is clearly wrong.
* Implement Overlap queriesRémi Nicole2018-06-19
| | | | | | | | | | | | | | | | | | | | Summary: Notes: - Introduces the concept of queries on multiple properties (which meant changing query's internals a bit) - Dates are stored as well as the "reference" in the index to allow quick filtering without fetching the whole entity - Buckets are weeks starting on Monday (guaranteed by the use of the Julian calendar) - Some size improvements are definitely possible (dates are padded numbers again, not using integer databases, Julian calendar starts at a very old date, etc.) Test Plan: Tested in querytest Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13477
* CleanupChristian Mollekopf2018-05-29
|
* Avoid building tests that link to the resource on windows.Christian Mollekopf2018-05-28
| | | | | Because we'd have to properly export the symbols for the linking on windows to work.
* Cleaned up some unnecessary dependencies.Christian Mollekopf2018-05-28
|
* Implement ranged queriesRémi Nicole2018-05-28
| | | | | | | | | | | | | | | Summary: Notes: - For now, only for QDateTime indexes - Invalid QDateTimes are stored in the index (subject to change) - Should be a drop-in replacement from ValueIndexes (except for `In` and `Contains` queries) Reviewers: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13105
* Add findAllInRange function in the storage layerRémi Nicole2018-05-24
| | | | | | | | | | | | | | | | | Summary: In preparation of the support for ranged queries. Notes: Since they are pretty similar, it could be nice to refactor `scan` and `findAllInRange` to use common 3rd function Test Plan: This is tested in storagetest.cpp Reviewers: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13066
* CleanupChristian Mollekopf2018-05-23
|
* Fixed use of mdb_dbi_openChristian Mollekopf2018-05-23
| | | | | | | | | | | | | | | | | | | | There can only ever be one transaction using mdb_dbi_open running, and that transaction must commit or abort before any other transaction attempts to use mdb_dbi_open. Use delayed dbi merging with write transactions and a temporary transaction for read transactions. We now protect dbi initialization with a mutex and immediately update the sDbis hash. This assumes that the created dbis are indeed We can still violate the only one transaction may use mdb_dbi_open rule if we start a read-only transaction after the write transaction, before the write transaction commits. It does not seem to be something we actually do though. Opening dbis on environment init is further separated out, so we don't end up in the regular openDatabase codepath at all.
* Use VERIFYEXECChristian Mollekopf2018-05-20
|
* Get ctest to find the executable on windowsChristian Mollekopf2018-05-19
|
* Exports for windowsChristian Mollekopf2018-05-19
|
* the right target for generate_export_header.Christian Mollekopf2018-05-19
|
* Moved the bogus message test to the imap test.Christian Mollekopf2018-05-18
| | | | Maildir will happly store anything.
* Test what happens if we add a bogus message to the imap resource.Christian Mollekopf2018-05-18
| | | | This test currently fails because we fail to recover.
* Fixed a readEntity call with empty uidChristian Mollekopf2018-05-17
| | | | | | Filtered entites are still passed through as removal, but if there is no other value for the reduction, the reduction result is empty.
* Restrict the query to the relevant resourceChristian Mollekopf2018-05-14
|
* Filter by senderChristian Mollekopf2018-05-07
|
* Export from sink_test so we can link against it on windowsChristian Mollekopf2018-04-20
|
* More exportsChristian Mollekopf2018-04-20
|
* Windows compatChristian Mollekopf2018-04-19
|
* Change most of Event's properties to extracted propertiesRémi Nicole2018-04-13
| | | | | | | | | | | | | | Summary: Fix T8485 Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Maniphest Tasks: T8485 Differential Revision: https://phabricator.kde.org/D12106
* Use the Dummy instead of Event in the benchmark to restore theChristian Mollekopf2018-04-10
| | | | attachment.
* Avoid missing revision updates while a query is running.Christian Mollekopf2018-04-01
| | | | | Instead we have to remember that something has changed and rerun an incremental query.
* Fixed unusedChristian Mollekopf2018-03-28
|
* Add CalDAV supportRémi Nicole2018-03-27
| | | | | | | | | | | | | | | | | | | | | Summary: Notes: - Add a `webdavcommon` folder for WebDAV generic resource code - Move `davresource` to `carddaveresource` and make it use the WebDAV code - For now it tests the CalDAV resource directly on KolabNow (to be changed) - Only synchronization, not adding / changing / removing WebDAV collections or items (to be implemented) - Only events are currently supported (todo, freebusy, etc. are to be implemented but should be straightforward) Fixes T8224 Reviewers: cmollekopf Tags: #sink Maniphest Tasks: T8224 Differential Revision: https://phabricator.kde.org/D11741
* Make sure we initialize the environment correctly and only set the db ↵Christian Mollekopf2018-03-26
| | | | version when creating it