Skip to content

MUTANTS! #212

@marvin-j97

Description

@marvin-j97

This is a long-term ticket to improve code coverage by removing missed mutants.
Some are low-hanging fruits, but I will donate 10€ to cargo-mutants for every actual bug the mutation tests find.

Here's the result of a cargo-mutants run I did as of 2b5d8a7:

src/backpressure.rs:115:65: replace > with < in handle_write_buffer
src/backpressure.rs:115:65: replace > with == in handle_write_buffer
src/backpressure.rs:126:37: replace >= with < in handle_write_buffer
src/backpressure.rs:139:34: replace += with *= in handle_write_buffer
src/backpressure.rs:139:34: replace += with -= in handle_write_buffer
src/backpressure.rs:143:32: replace > with < in handle_write_buffer
src/backpressure.rs:143:32: replace > with == in handle_write_buffer
src/backpressure.rs:14:5: replace handle_journal with ()
src/backpressure.rs:149:32: replace > with < in handle_write_buffer
src/backpressure.rs:149:32: replace > with == in handle_write_buffer
src/backpressure.rs:22:7: replace > with == in handle_journal
src/backpressure.rs:26:28: replace > with < in handle_journal
src/backpressure.rs:26:28: replace > with == in handle_journal
src/backpressure.rs:40:65: replace > with < in handle_journal
src/backpressure.rs:40:65: replace > with == in handle_journal
src/backpressure.rs:57:32: replace > with < in handle_journal
src/backpressure.rs:57:32: replace > with == in handle_journal
src/backpressure.rs:63:32: replace > with < in handle_journal
src/backpressure.rs:63:32: replace > with == in handle_journal
src/backpressure.rs:84:5: replace handle_write_buffer with ()
src/backpressure.rs:93:33: replace - with + in handle_write_buffer
src/backpressure.rs:93:33: replace - with / in handle_write_buffer
src/backpressure.rs:97:28: replace > with < in handle_write_buffer
src/backpressure.rs:97:28: replace > with == in handle_write_buffer
src/batch/item.rs:29:9: replace <impl Debug for Item>::fmt -> std::fmt::Result with Ok(Default::default())
src/batch/mod.rs:148:62: replace == with != in Batch::commit
src/batch/mod.rs:51:9: replace Batch::len -> usize with 1
src/batch/mod.rs:57:9: replace Batch::is_empty -> bool with false
src/batch/mod.rs:75:9: replace Batch::remove with ()
src/batch/mod.rs:91:9: replace Batch::remove_weak with ()
src/compaction/worker.rs:15:5: replace run -> crate::Result<()> with Ok(())
src/db_config.rs:50:5: replace get_open_file_limit -> usize with 0
src/db_config.rs:50:5: replace get_open_file_limit -> usize with 1
src/db.rs:196:12: delete ! in Database::batch
src/db.rs:224:9: replace Database::outstanding_flushes -> usize with 0
src/db.rs:224:9: replace Database::outstanding_flushes -> usize with 1
src/db.rs:235:9: replace Database::time_compacting -> std::time::Duration with Default::default()
src/db.rs:251:9: replace Database::active_compactions -> usize with 0
src/db.rs:251:9: replace Database::active_compactions -> usize with 1
src/db.rs:264:9: replace Database::compactions_completed -> usize with 0
src/db.rs:264:9: replace Database::compactions_completed -> usize with 1
src/db.rs:284:9: replace Database::journal_count -> usize with 1
src/db.rs:294:9: replace Database::journal_disk_space -> crate::Result<u64> with Ok(1)
src/db.rs:295:13: replace + with - in Database::journal_disk_space
src/db.rs:318:9: replace Database::disk_space -> crate::Result<u64> with Ok(1)
src/db.rs:328:25: replace + with - in Database::disk_space
src/db.rs:356:9: replace Database::persist -> crate::Result<()> with Ok(())
src/db.rs:377:9: replace Database::cache_capacity -> u64 with 0
src/db.rs:377:9: replace Database::cache_capacity -> u64 with 1
src/db.rs:479:9: replace Database::keyspace_count -> usize with 0
src/db.rs:479:9: replace Database::keyspace_count -> usize with 1
src/db.rs:485:9: replace Database::list_keyspaces -> Vec<KeyspaceKey> with vec![]
src/db.rs:485:9: replace Database::list_keyspaces -> Vec<KeyspaceKey> with vec![Default::default()]
src/db.rs:518:9: replace Database::seqno -> crate::SeqNo with Default::default()
src/db.rs:522:9: replace Database::check_version -> crate::Result<()> with Ok(())
src/db.rs:525:24: replace == with != in Database::check_version
src/db.rs:528:30: replace > with == in Database::check_version
src/db.rs:660:59: replace > with < in Database::recover
src/db.rs:722:36: replace + with * in Database::recover
src/db.rs:87:13: replace > with < in <impl Drop for DatabaseInner>::drop
src/drop.rs:11:5: replace increment_drop_counter with ()
src/drop.rs:15:5: replace decrement_drop_counter with ()
src/drop.rs:19:5: replace get_drop_counter -> &'a AtomicUsize with &Default::default()
src/drop.rs:24:5: replace load_drop_counter -> usize with 0
src/drop.rs:24:5: replace load_drop_counter -> usize with 1
src/error.rs:55:9: replace <impl Display for Error>::fmt -> std::fmt::Result with Ok(Default::default())
src/error.rs:73:9: replace <impl Error for Error>::source -> Option<&(dyn std::error::Error +'static)> with None
src/file.rs:18:5: replace fsync_directory -> std::io::Result<()> with Ok(())
src/flush/manager.rs:24:9: replace FlushManager::len -> usize with 0
src/flush/manager.rs:24:9: replace FlushManager::len -> usize with 1
src/flush/manager.rs:32:9: replace FlushManager::wait_for_empty with ()
src/flush/task.rs:9:9: replace <impl Debug for Task>::fmt -> std::fmt::Result with Ok(Default::default())
src/guard.rs:46:9: replace Guard::size -> crate::Result<u32> with Ok(0)
src/guard.rs:46:9: replace Guard::size -> crate::Result<u32> with Ok(1)
src/journal/batch_reader.rs:105:43: replace > with < in <impl Iterator for JournalBatchReader>::next
src/journal/batch_reader.rs:51:9: replace JournalBatchReader::truncate_to -> crate::Result<()> with Ok(())
src/journal/batch_reader.rs:63:9: replace JournalBatchReader::on_close -> crate::Result<()> with Ok(())
src/journal/error.rs:48:9: replace <impl Display for RecoveryError>::fmt -> std::fmt::Result with Ok(Default::default())
src/journal/manager.rs:106:20: delete ! in JournalManager::maintenance
src/journal/manager.rs:116:39: replace < with > in JournalManager::maintenance
src/journal/manager.rs:19:9: replace <impl Debug for EvictionWatermark>::fmt -> std::fmt::Result with Ok(Default::default())
src/journal/manager.rs:31:9: replace <impl Debug for Item>::fmt -> std::fmt::Result with Ok(Default::default())
src/journal/manager.rs:51:9: replace <impl Drop for JournalManager>::drop with ()
src/journal/manager.rs:81:9: replace JournalManager::journal_count -> usize with 1
src/journal/manager.rs:86:9: replace JournalManager::sealed_journal_count -> usize with 0
src/journal/manager.rs:91:9: replace JournalManager::disk_space_used -> u64 with 0
src/journal/manager.rs:91:9: replace JournalManager::disk_space_used -> u64 with 1
src/journal/mod.rs:111:9: replace Journal::persist -> crate::Result<()> with Ok(())
src/journal/mod.rs:31:9: replace <impl Debug for Journal>::fmt -> std::fmt::Result with Ok(Default::default())
src/journal/mod.rs:37:9: replace <impl Drop for Journal>::drop with ()
src/journal/reader.rs:45:9: replace JournalReader::truncate_file -> crate::Result<()> with Ok(())
src/journal/reader.rs:52:9: replace JournalReader::maybe_truncate_file_to_last_valid_pos -> crate::Result<()> with Ok(())
src/journal/reader.rs:54:23: replace > with < in JournalReader::maybe_truncate_file_to_last_valid_pos
src/journal/reader.rs:54:23: replace > with == in JournalReader::maybe_truncate_file_to_last_valid_pos
src/journal/recovery.rs:82:52: replace + with * in recover_journals
src/journal/recovery.rs:82:52: replace + with - in recover_journals
src/journal/writer.rs:19:41: replace * with +
src/journal/writer.rs:19:49: replace * with +
src/journal/writer.rs:19:49: replace * with /
src/journal/writer.rs:200:9: replace Writer::persist -> std::io::Result<()> with Ok(())
src/journal/writer.rs:21:43: replace * with +
src/journal/writer.rs:21:43: replace * with /
src/journal/writer.rs:268:20: replace += with *= in Writer::write_raw
src/journal/writer.rs:277:43: replace > with < in Writer::write_raw
src/journal/writer.rs:277:43: replace > with == in Writer::write_raw
src/journal/writer.rs:277:47: replace && with || in Writer::write_raw
src/journal/writer.rs:277:62: replace >= with < in Writer::write_raw
src/journal/writer.rs:287:20: replace += with *= in Writer::write_raw
src/journal/writer.rs:291:20: replace += with *= in Writer::write_raw
src/journal/writer.rs:291:20: replace += with -= in Writer::write_raw
src/journal/writer.rs:317:20: replace += with *= in Writer::write_batch
src/journal/writer.rs:329:47: replace > with < in Writer::write_batch
src/journal/writer.rs:329:47: replace > with == in Writer::write_batch
src/journal/writer.rs:329:51: replace && with || in Writer::write_batch
src/journal/writer.rs:329:71: replace >= with < in Writer::write_batch
src/journal/writer.rs:340:24: replace += with *= in Writer::write_batch
src/journal/writer.rs:346:20: replace += with *= in Writer::write_batch
src/journal/writer.rs:346:20: replace += with -= in Writer::write_batch
src/journal/writer.rs:54:9: replace Writer::set_compression with ()
src/journal/writer.rs:59:9: replace Writer::len -> crate::Result<u64> with Ok(1)
src/keyspace/mod.rs:1085:12: delete ! in Keyspace::remove_weak
src/keyspace/mod.rs:184:19: replace == with != in <impl PartialEq for Keyspace>::eq
src/keyspace/mod.rs:184:9: replace <impl PartialEq for Keyspace>::eq -> bool with false
src/keyspace/mod.rs:184:9: replace <impl PartialEq for Keyspace>::eq -> bool with true
src/keyspace/mod.rs:192:9: replace <impl Hash for Keyspace>::hash with ()
src/keyspace/mod.rs:202:9: replace Keyspace::fragmented_blob_bytes -> u64 with 0
src/keyspace/mod.rs:202:9: replace Keyspace::fragmented_blob_bytes -> u64 with 1
src/keyspace/mod.rs:223:9: replace Keyspace::ingest -> crate::Result<()> with Ok(())
src/keyspace/mod.rs:330:9: replace Keyspace::metrics -> &lsm_tree::Metrics with &Default::default()
src/keyspace/mod.rs:355:9: replace Keyspace::disk_space -> u64 with 0
src/keyspace/mod.rs:671:9: replace Keyspace::is_kv_separated -> bool with false
src/keyspace/mod.rs:671:9: replace Keyspace::is_kv_separated -> bool with true
src/keyspace/mod.rs:746:46: replace >= with < in Keyspace::rotate_memtable
src/keyspace/mod.rs:757:9: replace Keyspace::check_write_halt with ()
src/keyspace/mod.rs:759:40: replace >= with < in Keyspace::check_write_halt
src/keyspace/mod.rs:762:32: replace > with < in Keyspace::check_write_halt
src/keyspace/mod.rs:762:32: replace > with == in Keyspace::check_write_halt
src/keyspace/mod.rs:772:36: replace > with < in Keyspace::check_write_halt
src/keyspace/mod.rs:772:36: replace > with == in Keyspace::check_write_halt
src/keyspace/mod.rs:788:9: replace Keyspace::local_backpressure with ()
src/keyspace/mod.rs:790:25: replace >= with < in Keyspace::local_backpressure
src/keyspace/mod.rs:805:9: replace Keyspace::global_backpressure with ()
src/keyspace/mod.rs:820:17: replace > with == in Keyspace::check_memtable_rotate
src/keyspace/mod.rs:820:9: replace Keyspace::check_memtable_rotate -> crate::Result<()> with Ok(())
src/keyspace/mod.rs:831:9: replace Keyspace::maintenance -> crate::Result<()> with Ok(())
src/keyspace/mod.rs:840:9: replace Keyspace::l0_table_count -> usize with 0
src/keyspace/mod.rs:840:9: replace Keyspace::l0_table_count -> usize with 1
src/keyspace/mod.rs:847:9: replace Keyspace::table_count -> usize with 0
src/keyspace/mod.rs:847:9: replace Keyspace::table_count -> usize with 1
src/keyspace/mod.rs:854:9: replace Keyspace::blob_file_count -> usize with 0
src/keyspace/mod.rs:854:9: replace Keyspace::blob_file_count -> usize with 1
src/keyspace/mod.rs:864:9: replace Keyspace::major_compact -> crate::Result<()> with Ok(())
src/keyspace/mod.rs:925:12: delete ! in Keyspace::insert
src/keyspace/mod.rs:996:12: delete ! in Keyspace::remove
src/keyspace/name.rs:9:5: replace is_valid_keyspace_name -> bool with true
src/keyspace/options.rs:321:13: replace == with != in CreateOptions::from_kvs
src/keyspace/options.rs:605:9: replace CreateOptions::index_block_compression_policy -> Self with Default::default()
src/keyspace/options.rs:628:9: replace CreateOptions::manual_journal_persist -> Self with Default::default()
src/keyspace/options.rs:643:9: replace CreateOptions::max_memtable_size -> Self with Default::default()
src/keyspace/write_delay.rs:10:25: replace - with + in perform_write_stall
src/keyspace/write_delay.rs:10:25: replace - with / in perform_write_stall
src/keyspace/write_delay.rs:12:24: replace * with + in perform_write_stall
src/keyspace/write_delay.rs:12:24: replace * with / in perform_write_stall
src/keyspace/write_delay.rs:9:5: replace perform_write_stall with ()
src/locked_file.rs:7:9: replace <impl Drop for LockedFileGuardInner>::drop with ()
src/meta_keyspace.rs:160:44: replace + with * in MetaKeyspace::remove_keyspace
src/meta_keyspace.rs:63:9: replace MetaKeyspace::maintenance -> crate::Result<()> with Ok(())
src/poison_dart.rs:18:9: replace PoisonDart::poison with ()
src/poison_dart.rs:25:9: replace <impl Drop for PoisonDart>::drop with ()
src/recovery.rs:100:43: replace + with * in recover_keyspaces
src/recovery.rs:100:43: replace + with - in recover_keyspaces
src/recovery.rs:183:70: replace >= with < in recover_sealed_memtables
src/recovery.rs:209:75: replace + with * in recover_sealed_memtables
src/recovery.rs:209:75: replace + with - in recover_sealed_memtables
src/recovery.rs:231:33: replace += with *= in recover_sealed_memtables
src/recovery.rs:231:33: replace += with -= in recover_sealed_memtables
src/snapshot_nonce.rs:15:9: replace <impl Debug for SnapshotNonce>::fmt -> std::fmt::Result with Ok(Default::default())
src/snapshot.rs:51:9: replace <impl Readable for Snapshot>::contains_key -> crate::Result<bool> with Ok(true)
src/snapshot_tracker.rs:111:13: replace + with * in SnapshotTracker::close_raw
src/snapshot_tracker.rs:134:9: replace SnapshotTracker::pullup with ()
src/snapshot_tracker.rs:61:9: replace SnapshotTracker::len -> usize with 0
src/snapshot_tracker.rs:61:9: replace SnapshotTracker::len -> usize with 1
src/snapshot_tracker.rs:65:9: replace SnapshotTracker::open_snapshots -> usize with 0
src/snapshot_tracker.rs:65:9: replace SnapshotTracker::open_snapshots -> usize with 1
src/snapshot_tracker.rs:77:20: replace += with *= in SnapshotTracker::open
src/snapshot_tracker.rs:91:20: replace += with *= in SnapshotTracker::clone_snapshot
src/tx/optimistic/conflict_manager.rs:66:49: replace && with || in ConflictManager::mark_range
src/tx/optimistic/keyspace.rs:27:9: replace OptimisticTxKeyspace::path -> PathBuf with Default::default()
src/tx/optimistic/mod.rs:116:9: replace OptimisticTxDatabase::persist -> crate::Result<()> with Ok(())
src/tx/optimistic/mod.rs:149:9: replace OptimisticTxDatabase::keyspace_count -> usize with 0
src/tx/optimistic/mod.rs:149:9: replace OptimisticTxDatabase::keyspace_count -> usize with 1
src/tx/optimistic/mod.rs:155:9: replace OptimisticTxDatabase::list_keyspaces -> Vec<KeyspaceKey> with vec![]
src/tx/optimistic/mod.rs:155:9: replace OptimisticTxDatabase::list_keyspaces -> Vec<KeyspaceKey> with vec![Default::default()]
src/tx/optimistic/mod.rs:161:9: replace OptimisticTxDatabase::keyspace_exists -> bool with false
src/tx/optimistic/mod.rs:161:9: replace OptimisticTxDatabase::keyspace_exists -> bool with true
src/tx/optimistic/mod.rs:167:9: replace OptimisticTxDatabase::write_buffer_size -> u64 with 0
src/tx/optimistic/mod.rs:167:9: replace OptimisticTxDatabase::write_buffer_size -> u64 with 1
src/tx/optimistic/mod.rs:173:9: replace OptimisticTxDatabase::journal_count -> usize with 0
src/tx/optimistic/mod.rs:173:9: replace OptimisticTxDatabase::journal_count -> usize with 1
src/tx/optimistic/mod.rs:182:9: replace OptimisticTxDatabase::disk_space -> crate::Result<u64> with Ok(0)
src/tx/optimistic/mod.rs:78:12: delete ! in OptimisticTxDatabase::write_tx
src/tx/optimistic/oracle.rs:45:43: replace > with < in Oracle::with_commit
src/tx/optimistic/oracle.rs:45:43: replace > with == in Oracle::with_commit
src/tx/optimistic/write_tx.rs:101:9: replace <impl Readable for WriteTransaction>::size_of -> crate::Result<Option<u32>> with Ok(None)
src/tx/optimistic/write_tx.rs:101:9: replace <impl Readable for WriteTransaction>::size_of -> crate::Result<Option<u32>> with Ok(Some(0))
src/tx/optimistic/write_tx.rs:101:9: replace <impl Readable for WriteTransaction>::size_of -> crate::Result<Option<u32>> with Ok(Some(1))
src/tx/optimistic/write_tx.rs:29:9: replace <impl Display for Conflict>::fmt -> fmt::Result with Ok(Default::default())
src/tx/optimistic/write_tx.rs:474:9: replace WriteTransaction::rollback with ()
src/tx/optimistic/write_tx.rs:73:9: replace <impl Readable for WriteTransaction>::contains_key -> crate::Result<bool> with Ok(false)
src/tx/optimistic/write_tx.rs:73:9: replace <impl Readable for WriteTransaction>::contains_key -> crate::Result<bool> with Ok(true)
src/tx/optimistic/write_tx.rs:83:9: replace <impl Readable for WriteTransaction>::first_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/tx/optimistic/write_tx.rs:90:9: replace <impl Readable for WriteTransaction>::last_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/tx/single_writer/mod.rs:107:9: replace TxDatabase::persist -> crate::Result<()> with Ok(())
src/tx/single_writer/mod.rs:140:9: replace TxDatabase::keyspace_count -> usize with 0
src/tx/single_writer/mod.rs:140:9: replace TxDatabase::keyspace_count -> usize with 1
src/tx/single_writer/mod.rs:146:9: replace TxDatabase::list_keyspaces -> Vec<KeyspaceKey> with vec![]
src/tx/single_writer/mod.rs:146:9: replace TxDatabase::list_keyspaces -> Vec<KeyspaceKey> with vec![Default::default()]
src/tx/single_writer/mod.rs:152:9: replace TxDatabase::keyspace_exists -> bool with false
src/tx/single_writer/mod.rs:152:9: replace TxDatabase::keyspace_exists -> bool with true
src/tx/single_writer/mod.rs:158:9: replace TxDatabase::write_buffer_size -> u64 with 0
src/tx/single_writer/mod.rs:158:9: replace TxDatabase::write_buffer_size -> u64 with 1
src/tx/single_writer/mod.rs:164:9: replace TxDatabase::journal_count -> usize with 0
src/tx/single_writer/mod.rs:164:9: replace TxDatabase::journal_count -> usize with 1
src/tx/single_writer/mod.rs:173:9: replace TxDatabase::disk_space -> crate::Result<u64> with Ok(0)
src/tx/single_writer/mod.rs:173:9: replace TxDatabase::disk_space -> crate::Result<u64> with Ok(1)
src/tx/single_writer/mod.rs:69:12: delete ! in TxDatabase::write_tx
src/tx/single_writer/write_tx.rs:381:9: replace WriteTransaction<'tx>::rollback with ()
src/tx/single_writer/write_tx.rs:42:9: replace <impl Readable for WriteTransaction<'_>>::first_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/tx/single_writer/write_tx.rs:46:9: replace <impl Readable for WriteTransaction<'_>>::last_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/tx/single_writer/write_tx.rs:54:9: replace <impl Readable for WriteTransaction<'_>>::size_of -> crate::Result<Option<u32>> with Ok(None)
src/tx/single_writer/write_tx.rs:54:9: replace <impl Readable for WriteTransaction<'_>>::size_of -> crate::Result<Option<u32>> with Ok(Some(0))
src/tx/single_writer/write_tx.rs:54:9: replace <impl Readable for WriteTransaction<'_>>::size_of -> crate::Result<Option<u32>> with Ok(Some(1))
src/tx/write_tx.rs:101:9: replace <impl Readable for BaseTransaction>::size_of -> crate::Result<Option<u32>> with Ok(None)
src/tx/write_tx.rs:101:9: replace <impl Readable for BaseTransaction>::size_of -> crate::Result<Option<u32>> with Ok(Some(0))
src/tx/write_tx.rs:101:9: replace <impl Readable for BaseTransaction>::size_of -> crate::Result<Option<u32>> with Ok(Some(1))
src/tx/write_tx.rs:306:20: replace += with *= in BaseTransaction::remove
src/tx/write_tx.rs:306:20: replace += with -= in BaseTransaction::remove
src/tx/write_tx.rs:329:20: replace += with *= in BaseTransaction::remove_weak
src/tx/write_tx.rs:329:20: replace += with -= in BaseTransaction::remove_weak
src/tx/write_tx.rs:83:9: replace <impl Readable for BaseTransaction>::first_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/tx/write_tx.rs:90:9: replace <impl Readable for BaseTransaction>::last_key_value -> crate::Result<Option<KvPair>> with Ok(None)
src/version.rs:22:9: replace <impl Display for FormatVersion>::fmt -> std::fmt::Result with Ok(Default::default())
src/worker_pool.rs:148:30: replace > with < in worker_tick
src/worker_pool.rs:148:30: replace > with == in worker_tick
src/worker_pool.rs:148:51: replace == with != in worker_tick
src/worker_pool.rs:19:9: replace <impl Debug for WorkerMessage>::fmt -> std::fmt::Result with Ok(Default::default())
src/write_buffer_manager.rs:29:16: replace + with * in WriteBufferManager::allocate

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions