Skip to content

Commit e7fbf7d

Browse files
More thorough test
1 parent b07ebc8 commit e7fbf7d

File tree

1 file changed

+27
-1
lines changed
  • crates/worker/src/partition/state_machine/lifecycle

1 file changed

+27
-1
lines changed

crates/worker/src/partition/state_machine/lifecycle/restart.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ mod tests {
374374
use crate::partition::state_machine::Action;
375375
use crate::partition::state_machine::tests::TestEnv;
376376
use crate::partition::state_machine::tests::fixtures::{
377-
invoker_end_effect, invoker_entry_effect, pinned_deployment,
377+
invoker_end_effect, invoker_end_effect_for_epoch, invoker_entry_effect,
378+
invoker_entry_effect_for_epoch, pinned_deployment, pinned_deployment_for_epoch,
378379
};
379380
use crate::partition::state_machine::tests::matchers::storage::{
380381
has_commands, has_journal_length, is_epoch, is_variant,
@@ -960,6 +961,31 @@ mod tests {
960961
ok(eq(InvocationStatus::Free))
961962
);
962963

964+
// Complete the restarted invocation too
965+
let _ = test_env
966+
.apply_multiple([
967+
pinned_deployment_for_epoch(invocation_id, 1, ServiceProtocolVersion::V5),
968+
invoker_entry_effect_for_epoch(
969+
invocation_id,
970+
1,
971+
OutputCommand {
972+
result: OutputResult::Success(Bytes::from_static(b"456")),
973+
name: Default::default(),
974+
},
975+
),
976+
invoker_end_effect_for_epoch(invocation_id, 1),
977+
])
978+
.await;
979+
980+
// Nothing left for this invocation
981+
assert_that!(
982+
test_env
983+
.storage()
984+
.get_invocation_status(&invocation_id)
985+
.await,
986+
ok(eq(InvocationStatus::Free))
987+
);
988+
963989
test_env.shutdown().await;
964990
}
965991

0 commit comments

Comments
 (0)