From da8b31739c74393738e458317e6386f09bd75f49 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 14 Oct 2024 16:25:30 -0400 Subject: more get-test-job logging Signed-off-by: Kent Overstreet --- ci/test-git-branch.sh | 2 +- debootstrap | 2 +- src/bin/get-test-job.rs | 45 +++++++++++++++++++++++++++++++++++---------- src/lib.rs | 10 ++++++++-- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/ci/test-git-branch.sh b/ci/test-git-branch.sh index 679b5b7..e717cb1 100755 --- a/ci/test-git-branch.sh +++ b/ci/test-git-branch.sh @@ -222,7 +222,7 @@ while true; do [[ ${#TEST_JOB[@]} != 0 && ${TEST_JOB[0]} == TEST_JOB ]] && break - echo "No test job available" + echo "test-git-branch: No test job available" $ktest_once && exit 1 sleep 10 diff --git a/debootstrap b/debootstrap index ca11235..c9bb01c 160000 --- a/debootstrap +++ b/debootstrap @@ -1 +1 @@ -Subproject commit ca11235d35d6a1d4961f98c8c37000dd1ba9b041 +Subproject commit c9bb01c143de62f333b07c9172a2f7a7c092e910 diff --git a/src/bin/get-test-job.rs b/src/bin/get-test-job.rs index 9626f7c..cc7f8a1 100644 --- a/src/bin/get-test-job.rs +++ b/src/bin/get-test-job.rs @@ -49,6 +49,7 @@ fn get_test_job(args: &Args, rc: &Ktestrc, durations: Option<&[u8]>) -> Option) -> Option(age_str).unwrap(); - let test = str::from_utf8(fields.next().unwrap()).unwrap(); - let subtest = str::from_utf8(fields.next().unwrap()).unwrap(); + let test = fields.next().unwrap(); + let subtest = fields.next().unwrap(); if ret.is_some() && !commit_test_matches(&ret, commit, test) { + if args.verbose { + eprintln!("get-test-job: subtest from different test as previous, breaking"); + } break; } let stats = test_stats(durations, test, subtest); if args.verbose { - println!("stats for {}.{}={:?}", test, subtest, stats); + eprintln!("get-test-job: stats for {}.{}={:?}", test, subtest, stats); } let duration_secs = if let Some(s) = stats { s.duration @@ -87,12 +97,19 @@ fn get_test_job(args: &Args, rc: &Ktestrc, durations: Option<&[u8]>) -> Option rc.subtest_duration_max { + if args.verbose { + eprintln!("get-test-job: have {} > {} seconds of work, breaking", + duration_sum + duration_secs, rc.subtest_duration_max); + } break; } if !lockfile_exists(rc, &commit, &subtest_full_name(&test, &subtest), !args.dry_run, &mut commits_updated) { - break; + if args.verbose { + eprintln!("get-test-job: test {} already in progress", job); + } + continue; } if let Some(ref mut r) = ret { @@ -112,13 +129,20 @@ fn get_test_job(args: &Args, rc: &Ktestrc, durations: Option<&[u8]>) -> Option anyhow::Result { @@ -249,8 +251,12 @@ pub fn workers_get(ktestrc: &Ktestrc) -> anyhow::Result { use file_lock::{FileLock, FileOptions}; -pub fn workers_update(ktestrc: &Ktestrc, n: Worker) -> Option<()> { - let fname = ktestrc.output_dir.join("workers.capnp"); +pub fn workers_update(rc: &Ktestrc, n: Worker) -> Option<()> { + if rc.verbose { + eprintln!("workers_update: {:?}", n); + } + + let fname = rc.output_dir.join("workers.capnp"); let foptions = FileOptions::new().read(true).write(true).append(false).create(true); let mut filelock = FileLock::lock(fname, true, foptions) -- cgit v1.2.3