team-ljyzipelo

공개

암묵적 폴더의 출력 기록 한도를 맞춘다

작성자
호시노 히나타
작성 시각
커밋
78883af698ebf5fdac8d8e1006fb18701745f25f
부모
9224585
이 시점의 파일 보기

변경된 파일 4개

+131-8
수정docs/ui-scenario-guide.md+4-0
@@ -117,3 +117,7 @@ TAR.BZ2와 TAR.XZ의 자동 해제 폴더 이름은 미리보기에 표시되지
117117승인 후에도 상한과 공간 검사를 유지합니다. 취소 버튼과 Escape는 승인 대기 중 작업을 취소합니다.
118118Enter만으로 허용하지 않습니다. 기존 작업자로 자동 재시도하지 않습니다.
119119미리보기는 입력과 파일 쓰기를 막으며 실제 64 GiB 작업을 수행하지 않습니다.
120추가:
121추가: 승인된 작업의 목록 한도는 200,000개입니다. 출력 기록에는 압축파일에 따로 적혀 있지 않은
122추가: 상위 폴더도 포함되므로 작업자 메타데이터 정책과 같은 262,144개 노드까지 보관합니다.
123추가: 기본 작업의 출력 기록 한도는 100,000개를 유지합니다. 이 기록 정책 수정은 화면 요소를 바꾸지 않습니다.
수정experiments/rust-ui-memory-app/src/archive_ui.rs+3-2
@@ -867,8 +867,9 @@ impl Model {
867867 ..
868868 } => {
869869 if self.outputs.len()
870삭제: < if run.granted.entries {
871삭제: 200_000
870추가: < if run.granted.any() {
871추가: // 암묵적 상위 폴더도 출력되므로 작업자 노드 예산과 맞춤
872추가: 262_144
872873 } else {
873874 100_000
874875 }
수정tests/rust-app-real-worker/guarded_flows.rs+56-0
@@ -110,3 +110,59 @@ fn model_retry_uses_real_guarded_codec_and_requires_a_new_job_approval() {
110110 assert!(model.resource.is_none());
111111 }
112112}
113추가:
114추가: #[test]
115추가: fn approved_extraction_reports_implicit_parents_separately_from_entries() {
116추가: let scratch = Scratch::new();
117추가: let archive = scratch.path("implicit.zip");
118추가: let generated = std::process::Command::new("python3")
119추가: .arg("-c")
120추가: .arg("import sys, zipfile; z = zipfile.ZipFile(sys.argv[1], 'w'); [z.writestr(p, b'') for p in ['a/b/one', 'a/b/two', 'c/d/three']]; z.close()")
121추가: .arg(&archive)
122추가: .output()
123추가: .unwrap();
124추가: assert!(generated.status.success());
125추가: let mut factory = ProcessFactory::new(binary("zipelo-archive-worker"));
126추가: let mut model = Model::default();
127추가: assert!(model.begin(Start::List { archive }, &mut factory));
128추가: wait(&mut model);
129추가: assert!(model.confirmed, "{:?}", model.error);
130추가: assert_eq!(model.entries.len(), 3);
131추가: model.entries[0].bytes = Some(Limits::default().output + 1);
132추가: let destination = make_directory(&scratch.path("output"));
133추가: assert!(model.extract(destination.clone(), false, None, &mut factory));
134추가: let deadline = Instant::now() + Duration::from_secs(10);
135추가: while model.resource.is_none() {
136추가: model.poll();
137추가: assert!(model.error.is_none(), "{:?}", model.error);
138추가: assert!(Instant::now() < deadline);
139추가: std::thread::sleep(Duration::from_millis(1));
140추가: }
141추가: let question = model.resource.clone().unwrap();
142추가: assert!(question.scope.output && question.scope.entries);
143추가: assert!(model.outputs.is_empty());
144추가: assert!(model.resource_reply(model.job_id().unwrap(), question.id, true));
145추가: wait(&mut model);
146추가: assert!(model.confirmed, "{:?}", model.error);
147추가: assert_eq!(model.terminal.as_ref().unwrap().outcome, Outcome::Completed);
148추가: assert_eq!(model.terminal.as_ref().unwrap().created_count, 7);
149추가: assert_eq!(model.outputs.len(), 7);
150추가: for name in ["a", "a/b", "c", "c/d"] {
151추가: assert!(destination.join(name).is_dir());
152추가: assert!(
153추가: model
154추가: .outputs
155추가: .iter()
156추가: .any(|(p, d)| p == name && *d == Disposition::Created)
157추가: );
158추가: }
159추가: for name in ["a/b/one", "a/b/two", "c/d/three"] {
160추가: assert_eq!(fs::read(destination.join(name)).unwrap(), b"");
161추가: assert!(
162추가: model
163추가: .outputs
164추가: .iter()
165추가: .any(|(p, d)| p == name && *d == Disposition::Created)
166추가: );
167추가: }
168추가: }
수정tests/rust-app-ui/guarded.rs+68-6
@@ -215,8 +215,9 @@ fn entries_over_one_hundred_thousand_are_accepted_only_after_entry_approval() {
215215}
216216
217217#[test]
218삭제: fn output_history_ceiling_expands_only_after_entry_permission() {
219삭제: for approved in [false, true] {
218추가: fn output_history_ceiling_matches_approved_metadata_nodes() {
219추가: for permission in 0..4 {
220추가: let approved = permission != 0;
220221 let mut m = Model::default();
221222 let mut f = FakeFactory::manual();
222223 assert!(m.begin(
@@ -236,9 +237,9 @@ fn output_history_ceiling_expands_only_after_entry_permission() {
236237 let mut q = question(1);
237238 q.action = ActionKind::CreateZip;
238239 q.scope = ResourceScope {
239삭제: output: true,
240삭제: entries: true,
241삭제: ratio: false,
240추가: output: permission == 1,
241추가: entries: permission == 2,
242추가: ratio: permission == 3,
242243 };
243244 q.ceiling = Limits {
244245 input: u64::MAX,
@@ -248,7 +249,7 @@ fn output_history_ceiling_expands_only_after_entry_permission() {
248249 receive(&mut m, &f, Event::ResourceRequired(q));
249250 assert!(m.resource_reply(m.job_id().unwrap(), 1, true));
250251 }
251삭제: let cap = if approved { 200_000 } else { 100_000 };
252추가: let cap = if approved { 262_144 } else { 100_000 };
252253 for n in 0..=cap {
253254 assert!(m.error.is_none(), "{n}");
254255 receive(
@@ -265,3 +266,64 @@ fn output_history_ceiling_expands_only_after_entry_permission() {
265266 assert!(m.error.is_some());
266267 }
267268}
269추가:
270추가: #[test]
271추가: fn approved_implicit_directories_do_not_fail_valid_extraction() {
272추가: let mut m = Model::default();
273추가: let mut f = FakeFactory::default();
274추가: list(&mut m, &mut f);
275추가: m.entries[0].bytes = Some(Limits::default().output + 1);
276추가: f.state.borrow_mut().manual = true;
277추가: assert!(m.extract(path("out"), false, None, &mut f));
278추가: receive(&mut m, &f, Event::Accepted { encryption: true });
279추가: let mut q = question(1);
280추가: q.action = ActionKind::Extract;
281추가: q.scope = ResourceScope {
282추가: output: true,
283추가: entries: true,
284추가: ratio: false,
285추가: };
286추가: q.ceiling = Limits {
287추가: input: u64::MAX,
288추가: output: 64 * 1024 * 1024 * 1024,
289추가: entries: 200_000,
290추가: };
291추가: receive(&mut m, &f, Event::ResourceRequired(q));
292추가: assert!(m.resource_reply(m.job_id().unwrap(), 1, true));
293추가: for id in 0..100_001 {
294추가: for name in [format!("d{id}"), format!("d{id}/f")] {
295추가: receive(
296추가: &mut m,
297추가: &f,
298추가: Event::Output {
299추가: entry_id: None,
300추가: relative_name: name,
301추가: disposition: Disposition::Created,
302추가: },
303추가: );
304추가: }
305추가: }
306추가: receive(
307추가: &mut m,
308추가: &f,
309추가: Event::Terminal(Terminal {
310추가: outcome: Outcome::Completed,
311추가: error: None,
312추가: publication: Publication::Complete,
313추가: created_count: 200_002,
314추가: retained_partial_count: 0,
315추가: durability: Durability::Synced,
316추가: cleanup: Cleanup::Complete,
317추가: }),
318추가: );
319추가: f.state.borrow_mut().queue.extend([
320추가: HostEvent::StdoutEof,
321추가: HostEvent::StderrEof,
322추가: HostEvent::Exited { success: true },
323추가: ]);
324추가: pump(&mut m);
325추가: assert!(m.error.is_none(), "{:?}", m.error);
326추가: assert!(m.confirmed);
327추가: assert_eq!(m.outputs.len(), 200_002);
328추가: assert!(!m.can_retry_expanded());
329추가: }