rpuch commented on code in PR #6226:
URL: https://github.com/apache/ignite-3/pull/6226#discussion_r2195128292
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvTableStorage.java:
##########
@@ -423,4 +426,14 @@ private void busy(Runnable action) {
private String createStorageInfo() {
return IgniteStringFormatter.format("tableId={}",
tableDescriptor.getId());
}
+
+ /**
+ * Sets the {@link TestMvPartitionStorage} factory. Useful when you need
to change the behavior of a method in a test, for example. If
+ * you use setting mock stubs after creating a storage, you can get into a
race and as a result get {@link UnfinishedStubbingException}.
+ *
+ * <p>After running a test or test class, you must set the {@link
TestMvPartitionStorageFactory#DEFAULT}.</p>
Review Comment:
Can we swap the factory back in a `@AfterAll` of `BaseIgniteAbstractTest`?
That would make it impossible to forget.
##########
modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexNodeFinishedRwTransactionsCheckerTest.java:
##########
@@ -86,6 +114,13 @@ void setUp() {
void tearDown() {
dropAllTables();
dropAllZonesExceptDefaultOne();
+
+ beforeAddWriteCommittedFunction = null;
+ }
+
+ @AfterAll
+ static void afterAll() {
+
TestMvTableStorage.partitionStorageFactory(TestMvPartitionStorageFactory.DEFAULT);
Review Comment:
How about introducing a method on `TestMvTableStorage` like
`resetPartitionStorageFactory()` (without arguments) that would just set the
factory to `DEFAULT`? It would make it more difficult to make a mistake when
resetting to default factory
--
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]