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.
class TestRubyRuntimes:
    @pytest.mark.skipif(not use_docker(), reason="ruby runtimes not supported in local invocation")
    @pytest.mark.skip_snapshot_verify
    def test_ruby_lambda_running_in_docker(self, lambda_client, create_lambda_function, snapshot):
        """Test simple ruby lambda invocation"""
        snapshot.add_transformer(snapshot.transform.lambda_api())
        function_name = f"test-function-{short_uid()}"
        create_result = create_lambda_function(
            func_name=function_name,
            handler_file=TEST_LAMBDA_RUBY,
            handler="lambda_integration.handler",
            runtime=LAMBDA_RUNTIME_RUBY27,
        )
        snapshot.match("create-result", create_result)
        result = lambda_client.invoke(FunctionName=function_name, Payload=b"{}")
        result = read_streams(result)
        snapshot.match("invoke-result", result)
        result_data = result["Payload"]
        assert 200 == result["StatusCode"]
        assert "{}" == to_str(result_data).strip()
class TestGolangRuntimes:
    @pytest.mark.skip_snapshot_verify
    @pytest.mark.skip_offline
    def test_golang_lambda(self, lambda_client, tmp_path, create_lambda_function, snapshot):
        """Test simple golang lambda invocation"""
        snapshot.add_transformer(snapshot.transform.lambda_api())
        
        url = TEST_GOLANG_LAMBDA_URL_TEMPLATE.format(
            version=GO_RUNTIME_VERSION,