mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix CI red herrings; add more debug granularty
This commit is contained in:
parent
c02a8933ef
commit
fef355423b
5 changed files with 30 additions and 21 deletions
|
|
@ -655,7 +655,7 @@ impl BasisCache {
|
||||||
return Err(Error::new(ErrorKind::NotFound, "Requested basis not found, or PDDB not mounted."));
|
return Err(Error::new(ErrorKind::NotFound, "Requested basis not found, or PDDB not mounted."));
|
||||||
}
|
}
|
||||||
// make the reservation
|
// make the reservation
|
||||||
log::info!("reserving {} pages - {}", pages_needed, reserved_pages);
|
log::debug!("reserving {} pages - {}", pages_needed, reserved_pages);
|
||||||
if !hw.ensure_fast_space_alloc(pages_needed, &self.cache) {
|
if !hw.ensure_fast_space_alloc(pages_needed, &self.cache) {
|
||||||
return Err(Error::new(ErrorKind::OutOfMemory, "No free space to allocate dict"));
|
return Err(Error::new(ErrorKind::OutOfMemory, "No free space to allocate dict"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ impl DictCacheEntry {
|
||||||
}
|
}
|
||||||
// the key exists, *and* there's sufficient space for the data
|
// the key exists, *and* there's sufficient space for the data
|
||||||
if kcache.start < SMALL_POOL_END {
|
if kcache.start < SMALL_POOL_END {
|
||||||
log::debug!("doing data update");
|
log::debug!("doing data update of {}", name);
|
||||||
kcache.age = kcache.age.saturating_add(1);
|
kcache.age = kcache.age.saturating_add(1);
|
||||||
kcache.clean = false;
|
kcache.clean = false;
|
||||||
// it's a small key; note that we didn't consult the *size* of the key to determine its pool type:
|
// it's a small key; note that we didn't consult the *size* of the key to determine its pool type:
|
||||||
|
|
@ -534,7 +534,7 @@ impl DictCacheEntry {
|
||||||
// key does not exist (or was previously erased) -- create one or replace the erased one.
|
// key does not exist (or was previously erased) -- create one or replace the erased one.
|
||||||
// try to fit the key in the small pool first
|
// try to fit the key in the small pool first
|
||||||
if ((data.len() + offset) < SMALL_CAPACITY) && (alloc_hint.unwrap_or(0) < SMALL_CAPACITY) {
|
if ((data.len() + offset) < SMALL_CAPACITY) && (alloc_hint.unwrap_or(0) < SMALL_CAPACITY) {
|
||||||
log::debug!("creating small key");
|
log::debug!("creating small key {}", name);
|
||||||
// handle the case that we're a brand new dictionary and no small keys have ever been stored before.
|
// handle the case that we're a brand new dictionary and no small keys have ever been stored before.
|
||||||
if self.small_pool.len() == 0 {
|
if self.small_pool.len() == 0 {
|
||||||
self.small_pool.push(KeySmallPool::new());
|
self.small_pool.push(KeySmallPool::new());
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,14 @@ pub(crate) fn delete_pattern(hw: &mut PddbOs, basis_cache: &mut BasisCache,
|
||||||
for dictname in evicted_dicts.iter() {
|
for dictname in evicted_dicts.iter() {
|
||||||
let (keyname, keydata) = gen_key(dictname, keynum, key_lower_bound, key_upper_bound);
|
let (keyname, keydata) = gen_key(dictname, keynum, key_lower_bound, key_upper_bound);
|
||||||
// now we're ready to write it out
|
// now we're ready to write it out
|
||||||
|
match basis_cache.key_attributes(hw, dictname, &keyname, None) {
|
||||||
|
Ok(ka) => {
|
||||||
|
log::warn!("rng collision on keygen: {}, deleting key", keyname);
|
||||||
|
basis_cache.key_remove(hw, dictname, &keyname, None, false)?;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
}
|
||||||
|
}
|
||||||
if maybe_extra_reserved.is_none() {
|
if maybe_extra_reserved.is_none() {
|
||||||
// we do this slightly funky way instead of just passing Some(0) because we want to test the "None" path explicitly
|
// we do this slightly funky way instead of just passing Some(0) because we want to test the "None" path explicitly
|
||||||
basis_cache.key_update(hw, dictname, &keyname, &keydata, None,
|
basis_cache.key_update(hw, dictname, &keyname, &keydata, None,
|
||||||
|
|
@ -400,18 +408,18 @@ pub(crate) fn ci_tests(pddb_os: &mut PddbOs) -> Result<()> {
|
||||||
log::info!("Doing delete/add consistency with data extension");
|
log::info!("Doing delete/add consistency with data extension");
|
||||||
delete_add_dict_consistency(pddb_os, &mut basis_cache, None,
|
delete_add_dict_consistency(pddb_os, &mut basis_cache, None,
|
||||||
None, None, None, None)?;
|
None, None, None, None)?;
|
||||||
log::set_max_level(log::LevelFilter::Debug);
|
|
||||||
log::info!("Saving `dachecke` to local host");
|
log::info!("Saving `dachecke` to local host");
|
||||||
pddb_os.dbg_dump(Some("dachecke".to_string()), None);
|
pddb_os.dbg_dump(Some("dachecke".to_string()), None);
|
||||||
|
|
||||||
log::info!("Doing patch test");
|
log::info!("Doing patch test");
|
||||||
patch_test(pddb_os, &mut basis_cache, None, None, true)?;
|
patch_test(pddb_os, &mut basis_cache, None, None, true)?;
|
||||||
pddb_os.dbg_dump(Some("patche".to_string()), None);
|
pddb_os.dbg_dump(Some("patche".to_string()), None);
|
||||||
log::set_max_level(log::LevelFilter::Info);
|
|
||||||
|
|
||||||
|
log::set_max_level(log::LevelFilter::Debug);
|
||||||
log::info!("Doing delete pattern test");
|
log::info!("Doing delete pattern test");
|
||||||
delete_pattern(pddb_os, &mut basis_cache, None, None, None, None)?;
|
delete_pattern(pddb_os, &mut basis_cache, None, None, None, None)?;
|
||||||
pddb_os.dbg_dump(Some("patterne".to_string()), None);
|
pddb_os.dbg_dump(Some("patterne".to_string()), None);
|
||||||
|
log::set_max_level(log::LevelFilter::Info);
|
||||||
|
|
||||||
// extended tests.
|
// extended tests.
|
||||||
// allocation space curtailed to force resource exhaustion faster.
|
// allocation space curtailed to force resource exhaustion faster.
|
||||||
|
|
@ -519,7 +527,6 @@ pub(crate) fn ci_tests(pddb_os: &mut PddbOs) -> Result<()> {
|
||||||
assert!(merge2_list.difference(&merge_list).count() == 0, "merged list is different from the original list after remount");
|
assert!(merge2_list.difference(&merge_list).count() == 0, "merged list is different from the original list after remount");
|
||||||
list_all(pddb_os, &mut basis_cache);
|
list_all(pddb_os, &mut basis_cache);
|
||||||
|
|
||||||
log::set_max_level(log::LevelFilter::Debug);
|
|
||||||
log::info!("CI done");
|
log::info!("CI done");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ def main():
|
||||||
|
|
||||||
pass_log = {}
|
pass_log = {}
|
||||||
err_log = []
|
err_log = []
|
||||||
for seed in range(0, 201):
|
for seed in range(200, 401):
|
||||||
err_log.append("Starting seed {}".format(seed))
|
err_log.append("Starting seed {}".format(seed))
|
||||||
seed_env = os.environ
|
seed_env = os.environ
|
||||||
seed_env["XOUS_SEED"] = str(seed)
|
seed_env["XOUS_SEED"] = str(seed)
|
||||||
|
|
@ -34,7 +34,7 @@ def main():
|
||||||
# logging.info(line)
|
# logging.info(line)
|
||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
passing = True
|
passing = 'PASS'
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['cargo', 'xtask', 'run'],
|
['cargo', 'xtask', 'run'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|
@ -49,7 +49,7 @@ def main():
|
||||||
proc.kill()
|
proc.kill()
|
||||||
if time.time() - start_time > 20:
|
if time.time() - start_time > 20:
|
||||||
logging.debug("timeout on generation")
|
logging.debug("timeout on generation")
|
||||||
passing = False
|
passing = 'FAIL TIMEOUT'
|
||||||
break
|
break
|
||||||
if realtime_output:
|
if realtime_output:
|
||||||
if 'Seed' in realtime_output:
|
if 'Seed' in realtime_output:
|
||||||
|
|
@ -61,16 +61,18 @@ def main():
|
||||||
err_log.append(realtime_output)
|
err_log.append(realtime_output)
|
||||||
logging.debug("ran out of space")
|
logging.debug("ran out of space")
|
||||||
# passing = False # not a fail, because it's the test condition that's wrong, not the code
|
# passing = False # not a fail, because it's the test condition that's wrong, not the code
|
||||||
|
passing = 'OOM'
|
||||||
proc.kill()
|
proc.kill()
|
||||||
if "couldn't allocate memory" in realtime_output:
|
if "couldn't allocate memory" in realtime_output:
|
||||||
err_log.append(realtime_output)
|
err_log.append(realtime_output)
|
||||||
logging.debug("ran out of space")
|
logging.debug("ran out of space")
|
||||||
# passing = False # not a fail, because it's the test condition that's wrong, not the code
|
# passing = False # not a fail, because it's the test condition that's wrong, not the code
|
||||||
|
passing = 'OOM'
|
||||||
proc.kill()
|
proc.kill()
|
||||||
if 'Decryption auth error' in realtime_output:
|
if 'Decryption auth error' in realtime_output:
|
||||||
err_log.append(realtime_output)
|
err_log.append(realtime_output)
|
||||||
logging.debug("decryption auth error")
|
logging.debug("decryption auth error")
|
||||||
passing = False
|
passing = 'FAIL AUTH'
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
|
|
@ -84,7 +86,7 @@ def main():
|
||||||
realtime_output = proc.stdout.readline()
|
realtime_output = proc.stdout.readline()
|
||||||
if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 45):
|
if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 45):
|
||||||
if time.time() - start_time > 45:
|
if time.time() - start_time > 45:
|
||||||
passing = False
|
passing = 'FAIL ANALYSIS TIMEOUT'
|
||||||
logging.debug("analysis timed out")
|
logging.debug("analysis timed out")
|
||||||
proc.kill()
|
proc.kill()
|
||||||
break
|
break
|
||||||
|
|
@ -93,19 +95,15 @@ def main():
|
||||||
logging.info(realtime_output.strip())
|
logging.info(realtime_output.strip())
|
||||||
err_log.append(realtime_output)
|
err_log.append(realtime_output)
|
||||||
logging.debug("output contained errors")
|
logging.debug("output contained errors")
|
||||||
passing = False
|
passing = 'FAIL CI ERRORS'
|
||||||
if 'WARNING' in realtime_output:
|
if 'WARNING' in realtime_output:
|
||||||
logging.info(realtime_output.strip())
|
logging.info(realtime_output.strip())
|
||||||
err_log.append(realtime_output)
|
err_log.append(realtime_output)
|
||||||
logging.debug("output contained warnings")
|
logging.debug("output contained warnings")
|
||||||
passing = False
|
passing = 'FAIL CI WARNINGS'
|
||||||
|
|
||||||
if passing:
|
logging.info("Seed {} {}".format(seed, passing))
|
||||||
logging.info("Seed {} PASS".format(seed))
|
pass_log[seed] = passing
|
||||||
pass_log[seed] = 'PASS'
|
|
||||||
else:
|
|
||||||
logging.info("Seed {} FAIL".format(seed))
|
|
||||||
pass_log[seed] = 'FAIL'
|
|
||||||
|
|
||||||
for line in err_log:
|
for line in err_log:
|
||||||
logging.info(line)
|
logging.info(line)
|
||||||
|
|
|
||||||
|
|
@ -443,8 +443,12 @@ class BasisDicts:
|
||||||
if namecheck[1] != self.name:
|
if namecheck[1] != self.name:
|
||||||
logging.warning(" Key/dict mismatch: {}/{}".format(key.name, self.name))
|
logging.warning(" Key/dict mismatch: {}/{}".format(key.name, self.name))
|
||||||
keylen = int(namecheck[3][3:])
|
keylen = int(namecheck[3][3:])
|
||||||
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
|
if keylen > 12:
|
||||||
logging.warning(" Key named len vs disk len mismatch: {}/{}".format(keylen, key.len))
|
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:
|
||||||
|
logging.warning(" Key named len vs disk len mismatch: {}/{} (extension did not work correctly)".format(keylen, key.len))
|
||||||
if key.ci_ok == False:
|
if key.ci_ok == False:
|
||||||
logging.warning(" CI failed on key {}:".format(name))
|
logging.warning(" CI failed on key {}:".format(name))
|
||||||
logging.warning(key.as_str(' '))
|
logging.warning(key.as_str(' '))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue