M-ung opened a new issue, #8293:
URL: https://github.com/apache/gravitino/issues/8293
### Version
main branch
### Describe what's wrong
The test TestOwnerMetaService.testDeleteMetadataObject fails during a full
project build (./gradlew clean build) due to a
JdbcSQLIntegrityConstraintViolationException.
However, the test passes successfully when it is run in isolation. This
suggests it is a flaky test, likely caused by state leakage from other tests
that run prior to it in the full test suite.
### Error message and/or stacktrace
TestOwnerMetaService > testDeleteMetadataObject() FAILED
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause:
org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or
primary key violation: "PUBLIC.UK_OW_ME_DEL_INDEX_3 ON
PUBLIC.OWNER_META(OWNER_ID, METADATA_OBJECT_ID, METADATA_OBJECT_TYPE,
DELETED_AT) VALUES 25"; SQL statement:
UPDATE owner_meta SET deleted_at = (UNIX_TIMESTAMP() * 1000.0) +
EXTRACT(MICROSECOND FROM CURRENT_TIMESTAMP(3)) / 1000 WHERE owner_id = ? AND
owner_type = ? AND deleted_at = 0 [23505-200]
### The error may exist in
org/apache/gravitino/storage/relational/mapper/OwnerMetaMapper.java (best guess)
### The error may involve
org.apache.gravitino.storage.relational.mapper.OwnerMetaMapper.softDeleteOwnerRelByOwnerIdAndType-Inline
### The error occurred while setting parameters
### SQL: UPDATE owner_meta SET deleted_at = (UNIX_TIMESTAMP() * 1000.0)
+ EXTRACT(MICROSECOND FROM CURRENT_TIMESTAMP(3)) / 1000 WHERE owner_id = ? AND
owner_type = ? AND deleted_at = 0
### Cause: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException:
Unique index or primary key violation: "PUBLIC.UK_OW_ME_DEL_INDEX_3 ON
PUBLIC.OWNER_META(OWNER_ID, METADATA_OBJECT_ID, METADATA_OBJECT_TYPE,
DELETED_AT) VALUES 25"; SQL statement:
UPDATE owner_meta SET deleted_at = (UNIX_TIMESTAMP() * 1000.0) +
EXTRACT(MICROSECOND FROM CURRENT_TIMESTAMP(3)) / 1000 WHERE owner_id = ? AND
owner_type = ? AND deleted_at = 0 [23505-200]
at
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
at
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67)
at
org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
at
jdk.proxy3/jdk.proxy3.$Proxy119.softDeleteOwnerRelByOwnerIdAndType(Unknown
Source)
at
org.apache.gravitino.storage.relational.service.UserMetaService.lambda$deleteUser$12(UserMetaService.java:178)
...
at
org.apache.gravitino.storage.relational.service.TestOwnerMetaService.testDeleteMetadataObject(TestOwnerMetaService.java:516)
### How to reproduce
1. Set up the environment with JDK 17.
2. Run the full project build and test suite
`./gradlew clean build`
3. The build may fail with the error in the :core:test task.
4. To confirm it's a flaky test, run the failing test in isolation, which
should pass
`./gradlew :core:test --tests
"org.apache.gravitino.storage.relational.service.TestOwnerMetaService.testDeleteMetadataObject"`
### Additional context
This issue was discovered while working on an unrelated PR (#8292).
The failure seems to be pre-existing in the main branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]