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.
self.assertGreater(executor.function_invoke_times[func_arn], prev_invoke_time)
            else:
                self.assertGreater(executor.function_invoke_times[func_arn], 0)
            durations.append(duration)
        
        for i in range(1, num_iterations + 1):
            self.assertLess(durations[i], durations[0])
        status = executor.get_docker_container_status(func_arn)
        self.assertEqual(1, status)
        container_network = executor.get_docker_container_network(func_arn)
        self.assertEqual("bridge", container_network)
        executor.cleanup()
        status = executor.get_docker_container_status(func_arn)
        self.assertEqual(0, status)
        self.assertEqual(0, len(executor.get_all_container_names()))
        
        testutil.delete_lambda_function(func_name)
    @pytest.mark.skipif(
        condition=not isinstance(
            lambda_api.LAMBDA_EXECUTOR, lambda_executors.LambdaExecutorReuseContainers
        ),
        reason="Test only applicable if docker-reuse executor is selected",
    )
    def test_destroy_idle_containers(self):
        executor = lambda_api.LAMBDA_EXECUTOR
        func_name = "test_destroy_idle_containers"
        func_arn = lambda_api.func_arn(func_name)
        
        executor.destroy_existing_docker_containers()
        self.assertEqual(0, len(executor.get_all_container_names()))