hunk.code_window:             f.write("from test_module.test import one\n")
           yield tmp_dir
   @pytest.mark.parametrize("option", ["failure", "working_dir", "py_modules"])
   @pytest.mark.skipif(sys.platform == "win32", reason="Fail to create temp dir.")
   def test_lazy_reads(start_cluster, tmp_working_dir, option: str):
       """Tests the case where we lazily read files or import inside a task/actor.
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit: @pytest.mark.parametrize("option", [
       "failure", "working_dir", "py_modules", "py_modules_path",
       "working_dir_path"
   ])
  
hunk.file_path: python/ray/tests/test_runtime_env_working_dir.py
hunk.type: replace
file: /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package io.ray.streaming.state.keystate.state.impl;
  
  import io.ray.streaming.state.backend.OperatorStateBackend;
  import io.ray.streaming.state.backend.impl.MemoryStateBackend;
  import io.ray.streaming.state.keystate.desc.ListStateDescriptor;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import org.testng.Assert;
  import org.testng.annotations.BeforeClass;
  import org.testng.annotations.Test;
  
  public class OperatorStateImplTest {
  
    OperatorStateImpl<Integer> operatorState;
    ListStateDescriptor<Integer> descriptor;
    OperatorStateBackend operatorStateBackend;
  
    @BeforeClass
    public void setUp() {
      String table_name = "operatorState";
      Map config = new HashMap<>();
  
      operatorStateBackend = new OperatorStateBackend(new MemoryStateBackend(config));
  
      descriptor =
          ListStateDescriptor.build(
              "OperatorStateImplTest" + System.currentTimeMillis(), Integer.class, true);
      descriptor.setPartitionNumber(1);
      descriptor.setIndex(0);
      descriptor.setTableName(table_name);
  
      operatorState = (OperatorStateImpl<Integer>) operatorStateBackend.getSplitListState(descriptor);
    }
  
    @Test
    public void testInit() throws Exception {
      operatorStateBackend.setCheckpointId(1L);
      List<Integer> list = operatorState.get();
      Assert.assertEquals(list.size(), 0);
  
      for (int i = 0; i < 100; i++) {
        operatorState.add(i);
      }
      Assert.assertEquals(operatorState.get().size(), 100);
      operatorStateBackend.finish(1L);
      operatorStateBackend.commit(1L);
      operatorStateBackend.ackCommit(1L, 0);
  
      operatorStateBackend.finish(5L);
      operatorStateBackend.commit(5L);
      operatorStateBackend.ackCommit(5L, 0);
    }
  }
  