diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index efa2614cd..fdde320ce 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -845,6 +845,8 @@ impl PddbOs { for pp in self.fspace_cache.iter() { if (pp.space_state() == SpaceState::Free || pp.space_state() == SpaceState::Dirty) && (pp.journal() < PHYS_PAGE_JOURNAL_MAX) { free_count += 1; + } else { + log::trace!("fastpace other entry: {:?}", pp.space_state()); } if free_count >= count { return true @@ -948,14 +950,15 @@ impl PddbOs { /// and do a deep scan for space if the required amount is not available. pub fn ensure_fast_space_alloc(&mut self, pages: usize, cache: &Vec::) -> bool { const BUFFER: usize = 1; // a bit of slop in the trigger point - log::trace!("alloc fast_space_len: {}, log_len {}", self.fast_space_len(), self.fspace_log_len); + let has_pages = self.fast_space_has_pages(pages + BUFFER); + log::trace!("alloc fast_space_len: {}, log_len {}, has {} pages: {}", self.fast_space_len(), self.fspace_log_len, pages + BUFFER, has_pages); // make sure we have fast space pages... - if (self.fast_space_len() > pages + BUFFER) + if has_pages // ..and make sure we have space for fast space log entries && (self.fspace_log_len < (FSCB_PAGES - FASTSPACE_PAGES - 1) * PAGE_SIZE / aes::BLOCK_SIZE) { true } else { - if self.fast_space_len() <= pages + BUFFER { + if !has_pages { log::warn!("FastSpace alloc forced by lack of free space"); // if we're really out of space, do an expensive full-space sweep if let Some(used_pages) = self.pddb_generate_used_map(cache) { diff --git a/services/pddb/src/tests.rs b/services/pddb/src/tests.rs index 54fbb76cb..eaed0d444 100644 --- a/services/pddb/src/tests.rs +++ b/services/pddb/src/tests.rs @@ -415,11 +415,9 @@ pub(crate) fn ci_tests(pddb_os: &mut PddbOs) -> Result<()> { patch_test(pddb_os, &mut basis_cache, None, None, true)?; pddb_os.dbg_dump(Some("patche".to_string()), None); - log::set_max_level(log::LevelFilter::Debug); log::info!("Doing delete pattern test"); delete_pattern(pddb_os, &mut basis_cache, None, None, None, None)?; pddb_os.dbg_dump(Some("patterne".to_string()), None); - log::set_max_level(log::LevelFilter::Info); // extended tests. // allocation space curtailed to force resource exhaustion faster. @@ -470,11 +468,13 @@ pub(crate) fn ci_tests(pddb_os: &mut PddbOs) -> Result<()> { EXTRA_BASIS, EXTRA_BASIS_PW, BasisRetentionPolicy::Persist) { basis_cache.basis_add(basis2); } + log::set_max_level(log::LevelFilter::Debug); log::info!("Adding keys to Basis2"); delete_add_dict_consistency(pddb_os, &mut basis_cache, Some(3), Some(15), None, None, Some(EXTRA_BASIS))?; log::info!("Saving `basis2` to local host"); pddb_os.dbg_dump(Some("basis2".to_string()), Some(&export)); + log::set_max_level(log::LevelFilter::Info); let mut merge_list = HashSet::::new(); for dict in basis_cache.dict_list(pddb_os, None).iter() { diff --git a/tools/pddbci.py b/tools/pddbci.py index 088319ebd..609714103 100644 --- a/tools/pddbci.py +++ b/tools/pddbci.py @@ -23,7 +23,7 @@ def main(): pass_log = {} err_log = [] - for seed in range(200, 401): + for seed in range(0, 501): err_log.append("Starting seed {}".format(seed)) seed_env = os.environ seed_env["XOUS_SEED"] = str(seed) @@ -33,7 +33,6 @@ def main(): # if 'Seed' in line: # logging.info(line) - start_time = time.time() passing = 'PASS' proc = subprocess.Popen( ['cargo', 'xtask', 'run'], @@ -43,6 +42,7 @@ def main(): encoding='utf-8', errors='replace' ) + start_time = time.time() while True: realtime_output = proc.stdout.readline() if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 20): @@ -69,6 +69,12 @@ def main(): # passing = False # not a fail, because it's the test condition that's wrong, not the code passing = 'OOM' proc.kill() + if "No free space" in realtime_output: + err_log.append(realtime_output) + logging.debug("ran out of space") + # passing = False # not a fail, because it's the test condition that's wrong, not the code + passing = 'OOM' + proc.kill() if 'Decryption auth error' in realtime_output: err_log.append(realtime_output) logging.debug("decryption auth error") @@ -82,6 +88,7 @@ def main(): encoding='utf-8', errors='replace' ) + start_time = time.time() while True: realtime_output = proc.stdout.readline() if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 45): @@ -105,9 +112,11 @@ def main(): logging.info("Seed {} {}".format(seed, passing)) pass_log[seed] = passing - for line in err_log: - logging.info(line) + for line in err_log: + logging.info(line) + err_log = [] + # summary report for items in pass_log.items(): logging.info(items) diff --git a/tools/pddbdbg.py b/tools/pddbdbg.py index 904e0f186..0612d151b 100755 --- a/tools/pddbdbg.py +++ b/tools/pddbdbg.py @@ -447,7 +447,7 @@ class BasisDicts: if keylen != key.len and keylen + 4 != key.len: # the second case is what happens with the length extension test, it's actually not an error logging.warning(" Key named len vs disk len mismatch: {}/{}".format(keylen, key.len)) else: - if key.len != 17: + if key.len != 17 and key.len != 12: # 12 means we weren't extended. But, the test patch data extennds a 12-length key to 13, so with the checksum ts final length is 17. logging.warning(" Key named len vs disk len mismatch: {}/{} (extension did not work correctly)".format(keylen, key.len)) if key.ci_ok == False: logging.warning(" CI failed on key {}:".format(name))