Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gRNAet7B] Try de-flaky some tests with new procedure triggers #3355

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Dec 6, 2022

I cannot replicate this test with a real instance, so maybe is a TestDatabaseManagementServiceBuilder problem.

To solve this flaky test perhaps either we have to increase the apoc.trigger.refresh value or we have to separate the transactions in Trigger system node updates and setLastUpdate ([i.e. in that way]ff6e192).

I've been trying to figure out why these two things seem to de-flaky the tests, but i'm not really sure about it :X

Of course, the 2nd way it's not not recommended because we change the implementation and make the code less optimized.

In addition, to further stabilize the tests, I added a waitDbsAvailable.

Without these edits, with the embedded neo4j test instances, it seems like very rarely the TriggerHandler.updateCache() can't find the installed/updated node, but because of lastUpdate = System.currentTimeMillis(); (TriggerHandler, line 83 ) the updateCache is no longer called due to if (getLastUpdate() > lastUpdate) { (TriggerHandler, line 283).

@vga91 vga91 changed the title Try de-flaky some tests with new procedure triggers [gRNAet7B] Try de-flaky some tests with new procedure triggers Dec 6, 2022
@vga91 vga91 force-pushed the fix_flaky_trigger_new_procs branch from f741376 to f25e0bb Compare December 6, 2022 10:52
@vga91
Copy link
Collaborator Author

vga91 commented Dec 6, 2022

About this comment #3335 (comment).
I know it's weird, but for some reason by adding more triggers, the probability of making the test flaky seems higher (but anyway, it seems to affect only the embedded test instance)

Copy link
Contributor

@AzuObs AzuObs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Well done!

@vga91 vga91 merged commit 31a1e59 into neo4j-contrib:4.4 Dec 7, 2022
vga91 added a commit to neo4j/apoc that referenced this pull request Dec 15, 2022
…-contrib/neo4j-apoc-procedures#3355)

* Try de-flaky some tests with new procedure triggers
* moved TriggerTestUtil and increased trigger.refresh value
* added waitDbsAvailable util
vga91 added a commit to neo4j/apoc that referenced this pull request Dec 15, 2022
…-contrib/neo4j-apoc-procedures#3355)

* Try de-flaky some tests with new procedure triggers
* moved TriggerTestUtil and increased trigger.refresh value
* added waitDbsAvailable util
vga91 added a commit to neo4j/apoc that referenced this pull request Jan 3, 2023
…-contrib/neo4j-apoc-procedures#3355)

* Try de-flaky some tests with new procedure triggers
* moved TriggerTestUtil and increased trigger.refresh value
* added waitDbsAvailable util
vga91 added a commit to neo4j/apoc that referenced this pull request Jan 5, 2023
…-contrib/neo4j-apoc-procedures#3355)

* Try de-flaky some tests with new procedure triggers
* moved TriggerTestUtil and increased trigger.refresh value
* added waitDbsAvailable util
vga91 added a commit to neo4j/apoc that referenced this pull request Jan 9, 2023
* [gRNAet7B] Fixes trigger procedures in clusters (#3183)

* [gRNAet7B] Leaves it working for add trigger

* [gRNAet7B] Fixes trigger procedures with split LifeCycle and System utils

* Deprecated old triggers and included warning - Added check to fail if they are executed against a system = FOLLOWER

* Added cluster tests

* removed unused import

* changed msg wording

* split deprecated and new triggers

* Fixed TriggerExtendedTest

* update apoc.systemdb.export.metadata

* remove lastUpdate, rename classes

* added eventual consistency

* commonize trigger new and deprec. cache

* ignored tests

* added eventually separated tests - restored util.validateQuery - small changes

* renamed Trigger classes

* var names - test changes and additions

* nitpick and lightened test

* test flaky cluster

Co-authored-by: Giuseppe Villani <[email protected]>

* [gRNAet7B] Trigger procedures neo4j 5.x changes

* [gRNAet7B] code clean - removed unused import

* [gRNAet7B] Try fix flaky TriggerClusterRoutingTest (neo4j-contrib/neo4j-apoc-procedures#3323)

* [gRNAet7B] fix some tests

* [gRNAet7B] fix TriggerClusterRoutingTest

* [gRNAet7B] fix TriggerRouting error message

* [gRNAet7B] Added trigger show procedure (neo4j-contrib/neo4j-apoc-procedures#3335)

* Fix flaky trigger dbms availability tests
* added apoc.trigger.show proc
* retry to fix flaky test by separating setLastUpdate()
* removed updated output - some code refactoring
* split pr - changes review
* removed inner transaction
* updated documentation
* reset wrong generated docs
* Added admin in trigger.show
* small adoc changes

* [gRNAet7B] Try de-flaky some tests with new procedure triggers (neo4j-contrib/neo4j-apoc-procedures#3355)

* Try de-flaky some tests with new procedure triggers
* moved TriggerTestUtil and increased trigger.refresh value
* added waitDbsAvailable util

* [gRNAet7B] removed unused import

* [gRNAet7B] fix cluster test

* [gRNAet7B] added documentation about new trigger procedures and deprecated ones (neo4j-contrib/neo4j-apoc-procedures#3325)

* [gRNAet7B] added trigger new procs documentation
* changes review - procedure description
* changed listener wording
* added system db note
* var. small changes

* [gRNAet7B] Fixes triggers (neo4j-contrib/neo4j-apoc-procedures#3369)

* [coZSswV2] Fix typo in triggers error message

* [coZSswV2] Assert new triggers can't add TransactionEventListeners to "system"

* [coZSswV2] Assert old triggers can't add TransactionEventListeners to "system"

* [gRNAet7B] removed unused import

* [gRNAet7B] moved TriggerInfo class, removed wrong extended file

* [gRNAet7B] Add @Admin to trigger procedures (neo4j-contrib/neo4j-apoc-procedures#3357)

* [qwJFy8pp] Add @Admin to trigger procedures
* added admin in trigger.list and docs note
* changed admin doc

* [gRNAet7B] moved classes - changed TriggerInfo - err. handling changes

* [gRNAet7B] Cleanup trigger docs (neo4j-contrib/neo4j-apoc-procedures#3378)

* [gRNAet7B] added TriggerEnterpriseFeaturesTest, removed log and session db check

* [gRNAet7B] changed descriptions consistently with to Trigger.java 5.x ones

Co-authored-by: Nacho Cordón <[email protected]>
Co-authored-by: Daniel Leaver <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants