While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
lambda_client.delete_function(FunctionName=function_name)
    def test_code_updated_on_redeployment(self):
        lambda_api.LAMBDA_EXECUTOR.cleanup()
        func_name = "test_code_updated_on_redeployment"
        
        testutil.create_lambda_function(
            func_name=func_name,
            handler_file=TEST_LAMBDA_ENV,
            libs=TEST_LAMBDA_LIBS,
            envvars={"Hello": "World"},
        )
        
        result = self.lambda_client.invoke(FunctionName=func_name, Payload=b"{}")
        payload = json.loads(to_str(result["Payload"].read()))
        assert payload["Hello"] == "World"
        
        updated_handler = "handler = lambda event, context: {'Hello': 'Elon Musk'}"
        updated_handler = testutil.create_lambda_archive(
            updated_handler, libs=TEST_LAMBDA_LIBS, get_content=True
        )
        self.lambda_client.update_function_code(FunctionName=func_name, ZipFile=updated_handler)
        
        result = self.lambda_client.invoke(FunctionName=func_name, Payload=b"{}")
        payload = json.loads(to_str(result["Payload"].read()))
        assert payload["Hello"] == "Elon Musk"
    @pytest.mark.skipif(
        condition=not isinstance(
            lambda_api.LAMBDA_EXECUTOR, lambda_executors.LambdaExecutorReuseContainers
        ),
        reason="Test only applicable if docker-reuse executor is selected",