Java Code Examples for org.apache.flink.runtime.testutils.statemigration.TestType

The following examples show how to use org.apache.flink.runtime.testutils.statemigration.TestType. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testOperatorUnionListStateRegistrationFailsIfNewSerializerIsIncompatible() {
	final String stateName = "union-list-state";

	try {
		testOperatorUnionListStateUpgrade(
			new ListStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ListStateDescriptor<>(
				stateName,
				// restore with a new incompatible serializer
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed.");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	}
}
 
Example 2
Source Project: Flink-CEPplus   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testEagerlyRegisterIncompatibleSerializer() {
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromNewRegisteredSerializer(new TestType.IncompatibleTestTypeSerializer());

	// set previous serializer snapshot for state, which should let the new serializer be considered incompatible
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.setPreviousSerializerSnapshotForRestoredState(new TestType.V1TestTypeSerializer().snapshotConfiguration());
	assertTrue(schemaCompatibility.isIncompatible());

	try {
		// a serializer for the current schema will no longer be accessible
		testProvider.currentSchemaSerializer();

		fail();
	} catch (Exception excepted) {
		// success
	}
}
 
Example 3
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testKeyedValueStateRegistrationFailsIfNewStateSerializerIsIncompatible() {
	final String stateName = "test-name";

	try {
		testKeyedValueStateUpgrade(
			new ValueStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ValueStateDescriptor<>(
				stateName,
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed");
	} catch (Exception expected) {
		Assert.assertTrue(ExceptionUtils.findThrowable(expected, StateMigrationException.class).isPresent());
	}
}
 
Example 4
@Test
public void testKeyedValueStateRegistrationFailsIfNewStateSerializerIsIncompatible() throws Exception {
	final String stateName = "test-name";

	try {
		testKeyedValueStateUpgrade(
			new ValueStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ValueStateDescriptor<>(
				stateName,
				new TestType.IncompatibleTestTypeSerializer()));

		Assert.fail("should have failed");
	} catch (Exception expected) {
		Assert.assertTrue(ExceptionUtils.findThrowable(expected, StateMigrationException.class).isPresent());
	}
}
 
Example 5
@Test
public void testOperatorParitionableListStateRegistrationFailsIfNewSerializerIsIncompatible() throws Exception {
	final String stateName = "partitionable-list-state";

	try {
		testOperatorPartitionableListStateUpgrade(
			new ListStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ListStateDescriptor<>(
				stateName,
				// restore with a new incompatible serializer
				new TestType.IncompatibleTestTypeSerializer()));

		Assert.fail("should have failed.");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	}
}
 
Example 6
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testBroadcastStateRegistrationFailsIfNewValueSerializerIsIncompatible() {
	final String stateName = "broadcast-state";

	try {
		testBroadcastStateValueUpgrade(
			new MapStateDescriptor<>(
				stateName,
				IntSerializer.INSTANCE,
				new TestType.V1TestTypeSerializer()),
			new MapStateDescriptor<>(
				stateName,
				IntSerializer.INSTANCE,
				// new value serializer is incompatible
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed.");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	}
}
 
Example 7
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testOperatorParitionableListStateRegistrationFailsIfNewSerializerIsIncompatible() throws Exception {
	final String stateName = "partitionable-list-state";

	try {
		testOperatorPartitionableListStateUpgrade(
			new ListStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ListStateDescriptor<>(
				stateName,
				// restore with a new incompatible serializer
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed.");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	}
}
 
Example 8
Source Project: flink   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testLazilyRegisterIncompatibleSerializer() {
	TestType.V1TestTypeSerializer serializer = new TestType.V1TestTypeSerializer();
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromPreviousSerializerSnapshot(serializer.snapshotConfiguration());

	// register serializer that requires migration for state
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.registerNewSerializerForRestoredState(new TestType.IncompatibleTestTypeSerializer());
	assertTrue(schemaCompatibility.isIncompatible());

	try {
		// a serializer for the current schema will no longer be accessible
		testProvider.currentSchemaSerializer();

		fail();
	} catch (Exception excepted) {
		// success
	}
}
 
Example 9
Source Project: flink   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testEagerlyRegisterIncompatibleSerializer() {
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromNewRegisteredSerializer(new TestType.IncompatibleTestTypeSerializer());

	// set previous serializer snapshot for state, which should let the new serializer be considered incompatible
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.setPreviousSerializerSnapshotForRestoredState(new TestType.V1TestTypeSerializer().snapshotConfiguration());
	assertTrue(schemaCompatibility.isIncompatible());

	try {
		// a serializer for the current schema will no longer be accessible
		testProvider.currentSchemaSerializer();

		fail();
	} catch (Exception excepted) {
		// success
	}
}
 
Example 10
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testKeyedValueStateRegistrationFailsIfNewStateSerializerIsIncompatible() {
	final String stateName = "test-name";

	try {
		testKeyedValueStateUpgrade(
			new ValueStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ValueStateDescriptor<>(
				stateName,
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed");
	} catch (Exception expected) {
		Assert.assertTrue(ExceptionUtils.findThrowable(expected, StateMigrationException.class).isPresent());
	}
}
 
Example 11
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testKeyedListStateRegistrationFailsIfNewStateSerializerIsIncompatible() {
	final String stateName = "test-name";

	try {
		testKeyedListStateUpgrade(
			new ListStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer()),
			new ListStateDescriptor<>(
				stateName,
				new TestType.IncompatibleTestTypeSerializer()));

		fail("should have failed");
	} catch (Exception expected) {
		Assert.assertTrue(ExceptionUtils.findThrowable(expected, StateMigrationException.class).isPresent());
	}
}
 
Example 12
Source Project: flink   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testEagerlyRegisterIncompatibleSerializer() {
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromNewRegisteredSerializer(new TestType.IncompatibleTestTypeSerializer());

	// set previous serializer snapshot for state, which should let the new serializer be considered incompatible
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.setPreviousSerializerSnapshotForRestoredState(new TestType.V1TestTypeSerializer().snapshotConfiguration());
	assertTrue(schemaCompatibility.isIncompatible());

	try {
		// a serializer for the current schema will no longer be accessible
		testProvider.currentSchemaSerializer();

		fail();
	} catch (Exception excepted) {
		// success
	}
}
 
Example 13
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testBroadcastStateRegistrationFailsIfNewKeySerializerIsIncompatible() {
	final String stateName = "broadcast-state";

	try {
		testBroadcastStateKeyUpgrade(
			new MapStateDescriptor<>(
				stateName,
				new TestType.V1TestTypeSerializer(),
				IntSerializer.INSTANCE),
			new MapStateDescriptor<>(
				stateName,
				// new key serializer is incompatible
				new TestType.IncompatibleTestTypeSerializer(),
				IntSerializer.INSTANCE));

		fail("should have failed.");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	}
}
 
Example 14
Source Project: flink   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testLazilyRegisterNewSerializerRequiringReconfiguration() {
	TestType.V1TestTypeSerializer serializer = new TestType.V1TestTypeSerializer();
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromPreviousSerializerSnapshot(serializer.snapshotConfiguration());

	// register serializer that requires reconfiguration, and verify that
	// the resulting current schema serializer is the reconfigured one
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.registerNewSerializerForRestoredState(new TestType.ReconfigurationRequiringTestTypeSerializer());
	assertTrue(schemaCompatibility.isCompatibleWithReconfiguredSerializer());
	assertTrue(testProvider.currentSchemaSerializer().getClass() == TestType.V1TestTypeSerializer.class);
}
 
Example 15
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testBroadcastStateKeyMigration() throws Exception {
	final String stateName = "broadcast-state";

	testBroadcastStateKeyUpgrade(
		new MapStateDescriptor<>(
			stateName,
			new TestType.V1TestTypeSerializer(),
			IntSerializer.INSTANCE),
		new MapStateDescriptor<>(
			stateName,
			// new key serializer is a V2 serializer with a different schema
			new TestType.V2TestTypeSerializer(),
			IntSerializer.INSTANCE));
}
 
Example 16
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testBroadcastStateValueMigration() throws Exception {
	final String stateName = "broadcast-state";

	testBroadcastStateValueUpgrade(
		new MapStateDescriptor<>(
			stateName,
			IntSerializer.INSTANCE,
			new TestType.V1TestTypeSerializer()),
		new MapStateDescriptor<>(
			stateName,
			IntSerializer.INSTANCE,
			// new value serializer is a V2 serializer with a different schema
			new TestType.V2TestTypeSerializer()));
}
 
Example 17
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
private void testOperatorUnionListStateUpgrade(
		ListStateDescriptor<TestType> initialAccessDescriptor,
		ListStateDescriptor<TestType> newAccessDescriptorAfterRestore) throws Exception {

	CheckpointStreamFactory streamFactory = createStreamFactory();

	OperatorStateBackend backend = createOperatorStateBackend();

	try {
		ListState<TestType> state = backend.getUnionListState(initialAccessDescriptor);

		state.add(new TestType("foo", 13));
		state.add(new TestType("bar", 278));

		OperatorStateHandle snapshot = runSnapshot(
			backend.snapshot(1L, 2L, streamFactory, CheckpointOptions.forCheckpointWithDefaultLocation()));
		backend.dispose();

		backend = restoreOperatorStateBackend(snapshot);

		state = backend.getUnionListState(newAccessDescriptorAfterRestore);

		// the state backend should have decided whether or not it needs to perform state migration;
		// make sure that reading and writing each state partition works with the new serializer
		Iterator<TestType> iterator = state.get().iterator();
		assertEquals(new TestType("foo", 13), iterator.next());
		assertEquals(new TestType("bar", 278), iterator.next());
		Assert.assertFalse(iterator.hasNext());
		state.add(new TestType("new-entry", 777));
	} finally {
		backend.dispose();
	}
}
 
Example 18
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
private void testOperatorPartitionableListStateUpgrade(
		ListStateDescriptor<TestType> initialAccessDescriptor,
		ListStateDescriptor<TestType> newAccessDescriptorAfterRestore) throws Exception {

	CheckpointStreamFactory streamFactory = createStreamFactory();

	OperatorStateBackend backend = createOperatorStateBackend();

	try {
		ListState<TestType> state = backend.getListState(initialAccessDescriptor);

		state.add(new TestType("foo", 13));
		state.add(new TestType("bar", 278));

		OperatorStateHandle snapshot = runSnapshot(
			backend.snapshot(1L, 2L, streamFactory, CheckpointOptions.forCheckpointWithDefaultLocation()));
		backend.dispose();

		backend = restoreOperatorStateBackend(snapshot);

		state = backend.getListState(newAccessDescriptorAfterRestore);

		// make sure that reading and writing each state partition works with the new serializer
		Iterator<TestType> iterator = state.get().iterator();
		assertEquals(new TestType("foo", 13), iterator.next());
		assertEquals(new TestType("bar", 278), iterator.next());
		Assert.assertFalse(iterator.hasNext());
		state.add(new TestType("new-entry", 777));
	} finally {
		backend.dispose();
	}
}
 
Example 19
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
private void testBroadcastStateKeyUpgrade(
		MapStateDescriptor<TestType, Integer> initialAccessDescriptor,
		MapStateDescriptor<TestType, Integer> newAccessDescriptorAfterRestore) throws Exception {

	CheckpointStreamFactory streamFactory = createStreamFactory();

	OperatorStateBackend backend = createOperatorStateBackend();

	try {
		BroadcastState<TestType, Integer> state = backend.getBroadcastState(initialAccessDescriptor);

		state.put(new TestType("foo", 13), 3);
		state.put(new TestType("bar", 278), 5);

		OperatorStateHandle snapshot = runSnapshot(
			backend.snapshot(1L, 2L, streamFactory, CheckpointOptions.forCheckpointWithDefaultLocation()));
		backend.dispose();

		backend = restoreOperatorStateBackend(snapshot);

		state = backend.getBroadcastState(newAccessDescriptorAfterRestore);

		// the state backend should have decided whether or not it needs to perform state migration;
		// make sure that reading and writing each broadcast entry works with the new serializer
		assertEquals((Integer) 3, state.get(new TestType("foo", 13)));
		assertEquals((Integer) 5, state.get(new TestType("bar", 278)));
		state.put(new TestType("new-entry", 777), 17);
	} finally {
		backend.dispose();
	}
}
 
Example 20
Source Project: Flink-CEPplus   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test(expected = UnsupportedOperationException.class)
public void testSetSerializerSnapshotWithLazilyRegisteredSerializerProviderShouldFail() {
	TestType.V1TestTypeSerializer serializer = new TestType.V1TestTypeSerializer();
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromPreviousSerializerSnapshot(serializer.snapshotConfiguration());

	testProvider.setPreviousSerializerSnapshotForRestoredState(serializer.snapshotConfiguration());
}
 
Example 21
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testKeyedValueStateMigration() throws Exception {
	final String stateName = "test-name";

	testKeyedValueStateUpgrade(
		new ValueStateDescriptor<>(
			stateName,
			new TestType.V1TestTypeSerializer()),
		new ValueStateDescriptor<>(
			stateName,
			// restore with a V2 serializer that has a different schema
			new TestType.V2TestTypeSerializer()));
}
 
Example 22
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testBroadcastStateValueMigration() throws Exception {
	final String stateName = "broadcast-state";

	testBroadcastStateValueUpgrade(
		new MapStateDescriptor<>(
			stateName,
			IntSerializer.INSTANCE,
			new TestType.V1TestTypeSerializer()),
		new MapStateDescriptor<>(
			stateName,
			IntSerializer.INSTANCE,
			// new value serializer is a V2 serializer with a different schema
			new TestType.V2TestTypeSerializer()));
}
 
Example 23
Source Project: Flink-CEPplus   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testEagerlyRegisterNewSerializerRequiringReconfiguration() {
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromNewRegisteredSerializer(new TestType.ReconfigurationRequiringTestTypeSerializer());

	// set previous serializer snapshot, which should let the new serializer be considered to require reconfiguration,
	// and verify that the resulting current schema serializer is the reconfigured one
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.setPreviousSerializerSnapshotForRestoredState(new TestType.V1TestTypeSerializer().snapshotConfiguration());
	assertTrue(schemaCompatibility.isCompatibleWithReconfiguredSerializer());
	assertTrue(testProvider.currentSchemaSerializer().getClass() == TestType.V1TestTypeSerializer.class);
}
 
Example 24
@Test
public void testKeyedValueStateMigration() throws Exception {
	final String stateName = "test-name";

	testKeyedValueStateUpgrade(
		new ValueStateDescriptor<>(
			stateName,
			new TestType.V1TestTypeSerializer()),
		new ValueStateDescriptor<>(
			stateName,
			// restore with a V2 serializer that has a different schema
			new TestType.V2TestTypeSerializer()));
}
 
Example 25
Source Project: flink   Source File: StateSerializerProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testLazilyRegisterNewCompatibleAsIsSerializer() {
	TestType.V1TestTypeSerializer serializer = new TestType.V1TestTypeSerializer();
	StateSerializerProvider<TestType> testProvider = StateSerializerProvider.fromPreviousSerializerSnapshot(serializer.snapshotConfiguration());

	// register compatible serializer for state
	TypeSerializerSchemaCompatibility<TestType> schemaCompatibility =
		testProvider.registerNewSerializerForRestoredState(new TestType.V1TestTypeSerializer());
	assertTrue(schemaCompatibility.isCompatibleAsIs());

	assertTrue(testProvider.currentSchemaSerializer() instanceof TestType.V1TestTypeSerializer);
	assertTrue(testProvider.previousSchemaSerializer() instanceof TestType.V1TestTypeSerializer);
}
 
Example 26
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
private void testBroadcastStateKeyUpgrade(
		MapStateDescriptor<TestType, Integer> initialAccessDescriptor,
		MapStateDescriptor<TestType, Integer> newAccessDescriptorAfterRestore) throws Exception {

	CheckpointStreamFactory streamFactory = createStreamFactory();

	OperatorStateBackend backend = createOperatorStateBackend();

	try {
		BroadcastState<TestType, Integer> state = backend.getBroadcastState(initialAccessDescriptor);

		state.put(new TestType("foo", 13), 3);
		state.put(new TestType("bar", 278), 5);

		OperatorStateHandle snapshot = runSnapshot(
			backend.snapshot(1L, 2L, streamFactory, CheckpointOptions.forCheckpointWithDefaultLocation()));
		backend.dispose();

		backend = restoreOperatorStateBackend(snapshot);

		state = backend.getBroadcastState(newAccessDescriptorAfterRestore);

		// the state backend should have decided whether or not it needs to perform state migration;
		// make sure that reading and writing each broadcast entry works with the new serializer
		assertEquals((Integer) 3, state.get(new TestType("foo", 13)));
		assertEquals((Integer) 5, state.get(new TestType("bar", 278)));
		state.put(new TestType("new-entry", 777), 17);
	} finally {
		backend.dispose();
	}
}
 
Example 27
@Test
public void testKeyedListStateSerializerReconfiguration() throws Exception {
	final String stateName = "test-name";

	testKeyedListStateUpgrade(
		new ListStateDescriptor<>(
			stateName,
			new TestType.V1TestTypeSerializer()),
		new ListStateDescriptor<>(
			stateName,
			// the test fails if this serializer is used instead of a reconfigured new serializer
			new TestType.ReconfigurationRequiringTestTypeSerializer()));
}
 
Example 28
Source Project: flink   Source File: StateBackendMigrationTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testOperatorParitionableListStateMigration() throws Exception {
	final String stateName = "partitionable-list-state";

	testOperatorPartitionableListStateUpgrade(
		new ListStateDescriptor<>(
			stateName,
			new TestType.V1TestTypeSerializer()),
		new ListStateDescriptor<>(
			stateName,
			// restore with a V2 serializer that has a different schema
			new TestType.V2TestTypeSerializer()));
}
 
Example 29
@Test
public void testPriorityQueueStateCreationFailsIfNewSerializerIsNotCompatible() throws Exception {
	CheckpointStreamFactory streamFactory = createStreamFactory();
	SharedStateRegistry sharedStateRegistry = new SharedStateRegistry();

	AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);

	try {
		InternalPriorityQueue<TestType> internalPriorityQueue = backend.create(
			"testPriorityQueue", new TestType.V1TestTypeSerializer());

		internalPriorityQueue.add(new TestType("key-1", 123));
		internalPriorityQueue.add(new TestType("key-2", 346));
		internalPriorityQueue.add(new TestType("key-1", 777));

		KeyedStateHandle snapshot = runSnapshot(
			backend.snapshot(1L, 2L, streamFactory, CheckpointOptions.forCheckpointWithDefaultLocation()),
			sharedStateRegistry);
		backend.dispose();

		backend = restoreKeyedBackend(IntSerializer.INSTANCE, snapshot);
		backend.create(
			"testPriorityQueue", new TestType.IncompatibleTestTypeSerializer());

		Assert.fail("should have failed");
	} catch (Exception e) {
		Assert.assertTrue(ExceptionUtils.findThrowable(e, StateMigrationException.class).isPresent());
	} finally {
		backend.dispose();
	}
}
 
Example 30
@Test
public void testStateBackendRestoreFailsIfNewKeySerializerRequiresMigration() throws Exception {
	try {
		testKeySerializerUpgrade(
			new TestType.V1TestTypeSerializer(),
			new TestType.V2TestTypeSerializer());

		Assert.fail("should have failed");
	} catch (Exception expected) {
		// the new key serializer requires migration; this should fail the restore
		Assert.assertTrue(ExceptionUtils.findThrowable(expected, StateMigrationException.class).isPresent());
	}
}