mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +02:00
Fix flaky tests due to Entity name conflicts (#569)
* Fix flaky tests due to Entity name conflicts Objectify siliently replaces current registration of a given kind when another class is registered for this kind. There are several TestObject classes in the current code base, which by default are all mapped to the same kind. Tests have only been flaky because impacted tests need to run in specific orders for failures to happen. Using multiple executors in Gradle also reduced the likely hood of errors. To reproduce the problem run the following tests in order (e.g., by putting them in a test suite): 1. ExportCommitLogDiffActionTest 2. CreateAutoTimestampTest 3. RestoreCommitLogsActionTest In this PR, we - Made sure all entities have unique kinds. - Made all test entities register with AppEngineRule instead of directly with ObjectifyService. - Added code in AppEngineRule to check for re-registrations. - Added presumit check for forbidden direct registration.
This commit is contained in:
parent
e920e4d201
commit
aa0dcea537
13 changed files with 123 additions and 48 deletions
|
@ -99,6 +99,15 @@ PRESUBMITS = {
|
|||
"System.(out|err).println is only allowed in tools/ packages. Please "
|
||||
"use a logger instead.",
|
||||
|
||||
# ObjectifyService.register is restricted to main/ or AppEngineRule.
|
||||
PresubmitCheck(
|
||||
r".*\bObjectifyService\.register", "java", {
|
||||
"/build/", "/generated/", "node_modules/", "src/main/",
|
||||
"AppEngineRule.java"
|
||||
}):
|
||||
"ObjectifyService.register is not allowed in tests. Please use "
|
||||
"AppengineRule.register instead.",
|
||||
|
||||
# PostgreSQLContainer instantiation must specify docker tag
|
||||
PresubmitCheck(
|
||||
r"[\s\S]*new\s+PostgreSQLContainer(<[\s\S]*>)?\(\s*\)[\s\S]*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue