{"record":{"id":"e187ced8799e180c","repo":"risingwavelabs/risingwave","slug":"should-not-create-local-state-from-mockwaitepochst","errorCode":null,"errorMessage":"should not create local state from MockWaitEpochStateStore","messagePattern":"should not create local state from MockWaitEpochStateStore","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/stream/src/executor/dml.rs","lineNumber":509,"sourceCode":"        type Local = PanicStateStore;\n        type ReadSnapshot = PanicStateStore;\n        type VectorWriter = PanicStateStore;\n\n        async fn try_wait_epoch(\n            &self,\n            epoch: HummockReadEpoch,\n            options: TryWaitEpochOptions,\n        ) -> StorageResult<()> {\n            if let Some(tx) = self.wait_epoch_called_tx.lock().unwrap().take() {\n                assert!(tx.send((epoch, options)).is_ok());\n            }\n            let rx = self.wait_epoch_release_rx.lock().await.take().unwrap();\n            rx.await.unwrap();\n            Ok(())\n        }\n\n        async fn new_local(&self, _option: NewLocalOptions) -> Self::Local {\n            panic!(\"should not create local state from MockWaitEpochStateStore\")\n        }\n\n        async fn new_read_snapshot(\n            &self,\n            _epoch: HummockReadEpoch,\n            _options: NewReadSnapshotOptions,\n        ) -> StorageResult<Self::ReadSnapshot> {\n            panic!(\"should not read snapshot from MockWaitEpochStateStore\")\n        }\n\n        async fn new_vector_writer(&self, _options: NewVectorWriterOptions) -> Self::VectorWriter {\n            panic!(\"should not create vector writer from MockWaitEpochStateStore\")\n        }\n    }\n\n    #[tokio::test]\n    async fn test_dml_executor() {\n        let table_id = TableId::default();","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/dml.rs#L491-L527","documentation":"A deliberate `panic!` in `MockWaitEpochStateStore::new_local`. The mock only implements the wait-for-epoch-release behavior needed by DML executor tests; creating a local state store partition is unsupported and indicates the test setup used the mock beyond its intended scope.","triggerScenarios":"Calling `StateStore::new_local` on a `MockWaitEpochStateStore`, e.g. when building a stream executor that needs a `StateStoreLocal` from the mock.","commonSituations":"Test scaffolding wires MockWaitEpochStateStore into a component that writes via a local store; a refactor makes a previously inert code path call new_local; copy-pasting executor test setups that require local writes.","solutions":["Swap the mock for MemoryStateStore (or another StateStore with a real Local implementation) when the test needs local state.","Keep MockWaitEpochStateStore only for tests that solely exercise epoch-wait semantics.","Check new/refactored executor code paths that now call new_local and adjust the test fixture accordingly."],"exampleFix":"// before\nlet store = MockWaitEpochStateStore::new(...);\nlet local = store.new_local(opts).await?; // panics\n// after\nlet store = MemoryStateStore::new();\nlet local = store.new_local(opts).await?;","handlingStrategy":"validation","validationCode":"// ensure the fixture provides a real Local store\nlet store: Arc<dyn StateStore> = if needs_local_writes {\n    Arc::new(MemoryStateStore::new())\n} else {\n    Arc::new(MockWaitEpochStateStore::new(...))\n};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never call new_local on mocks; choose a store with a real Local impl.","Review executor refactors for newly introduced new_local calls.","Keep mock usage scoped to the single test that needs epoch-wait semantics."],"tags":["test-mock","panic","state-store","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}