암묵적 폴더의 출력 기록 한도를 맞춘다
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
78883af698ebf5fdac8d8e1006fb18701745f25f- 부모
- 9224585
변경된 파일 4개
+131-8| @@ -117,3 +117,7 @@ TAR.BZ2와 TAR.XZ의 자동 해제 폴더 이름은 미리보기에 표시되지 | ||
| 117 | 117 | 승인 후에도 상한과 공간 검사를 유지합니다. 취소 버튼과 Escape는 승인 대기 중 작업을 취소합니다. |
| 118 | 118 | Enter만으로 허용하지 않습니다. 기존 작업자로 자동 재시도하지 않습니다. |
| 119 | 119 | 미리보기는 입력과 파일 쓰기를 막으며 실제 64 GiB 작업을 수행하지 않습니다. |
| 120 | 추가: | |
| 121 | 추가: 승인된 작업의 목록 한도는 200,000개입니다. 출력 기록에는 압축파일에 따로 적혀 있지 않은 | |
| 122 | 추가: 상위 폴더도 포함되므로 작업자 메타데이터 정책과 같은 262,144개 노드까지 보관합니다. | |
| 123 | 추가: 기본 작업의 출력 기록 한도는 100,000개를 유지합니다. 이 기록 정책 수정은 화면 요소를 바꾸지 않습니다. |
| @@ -867,8 +867,9 @@ impl Model { | ||
| 867 | 867 | .. |
| 868 | 868 | } => { |
| 869 | 869 | if self.outputs.len() |
| 870 | 삭제: < if run.granted.entries { | |
| 871 | 삭제: 200_000 | |
| 870 | 추가: < if run.granted.any() { | |
| 871 | 추가: // 암묵적 상위 폴더도 출력되므로 작업자 노드 예산과 맞춤 | |
| 872 | 추가: 262_144 | |
| 872 | 873 | } else { |
| 873 | 874 | 100_000 |
| 874 | 875 | } |
| @@ -110,3 +110,59 @@ fn model_retry_uses_real_guarded_codec_and_requires_a_new_job_approval() { | ||
| 110 | 110 | assert!(model.resource.is_none()); |
| 111 | 111 | } |
| 112 | 112 | } |
| 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 | 추가: } |
| @@ -215,8 +215,9 @@ fn entries_over_one_hundred_thousand_are_accepted_only_after_entry_approval() { | ||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | #[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; | |
| 220 | 221 | let mut m = Model::default(); |
| 221 | 222 | let mut f = FakeFactory::manual(); |
| 222 | 223 | assert!(m.begin( |
| @@ -236,9 +237,9 @@ fn output_history_ceiling_expands_only_after_entry_permission() { | ||
| 236 | 237 | let mut q = question(1); |
| 237 | 238 | q.action = ActionKind::CreateZip; |
| 238 | 239 | q.scope = ResourceScope { |
| 239 | 삭제: output: true, | |
| 240 | 삭제: entries: true, | |
| 241 | 삭제: ratio: false, | |
| 240 | 추가: output: permission == 1, | |
| 241 | 추가: entries: permission == 2, | |
| 242 | 추가: ratio: permission == 3, | |
| 242 | 243 | }; |
| 243 | 244 | q.ceiling = Limits { |
| 244 | 245 | input: u64::MAX, |
| @@ -248,7 +249,7 @@ fn output_history_ceiling_expands_only_after_entry_permission() { | ||
| 248 | 249 | receive(&mut m, &f, Event::ResourceRequired(q)); |
| 249 | 250 | assert!(m.resource_reply(m.job_id().unwrap(), 1, true)); |
| 250 | 251 | } |
| 251 | 삭제: let cap = if approved { 200_000 } else { 100_000 }; | |
| 252 | 추가: let cap = if approved { 262_144 } else { 100_000 }; | |
| 252 | 253 | for n in 0..=cap { |
| 253 | 254 | assert!(m.error.is_none(), "{n}"); |
| 254 | 255 | receive( |
| @@ -265,3 +266,64 @@ fn output_history_ceiling_expands_only_after_entry_permission() { | ||
| 265 | 266 | assert!(m.error.is_some()); |
| 266 | 267 | } |
| 267 | 268 | } |
| 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 | 추가: } |