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.
m = re.match(expected_results[i], result)
            self.assertTrue(m)
            self.assertEqual(m.groups()[0], lambda_executors.Util.debug_java_port)
    def test_java_options_with_configured_debug_port(self):
        options = [
            "-agentlib:jdwp=transport=dt_socket,server=y,address=1234,suspend=y",
            "-agentlib:jdwp=transport=dt_socket,server=y,address=localhost:1234,suspend=y",
            "-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:1234,suspend=y",
            "-agentlib:jdwp=transport=dt_socket,server=y,address=*:1234,suspend=y",
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1234",
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:1234",
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:1234",
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:1234",
        ]
        for item in options:
            result = self.prepare_java_opts(item)
            self.assertEqual("1234", lambda_executors.Util.debug_java_port)
            self.assertEqual(item, result)
    def prepare_java_opts(self, java_opts):
        lambda_executors.config.LAMBDA_JAVA_OPTS = java_opts
        result = lambda_executors.Util.get_java_opts()
        return result
    def test_get_java_lib_folder_classpath(self):
        jar_file = os.path.join(new_tmp_dir(), "foo.jar")
        save_file(jar_file, "")
        classpath = lambda_executors.Util.get_java_classpath(jar_file)
        self.assertIn(".:foo.jar", classpath)
        self.assertIn("*.jar", classpath)
    def test_get_java_lib_folder_classpath_no_directories(self):
        base_dir = new_tmp_dir()