Xuanwo commented on code in PR #3904:
URL: 
https://github.com/apache/incubator-opendal/pull/3904#discussion_r1440282236


##########
core/tests/behavior/utils.rs:
##########
@@ -110,255 +103,89 @@ macro_rules! blocking_trials {
     };
 }
 
-/// ObjectReaderFuzzer is the fuzzer for object readers.
-///
-/// We will generate random read/seek/next operations to operate on object
-/// reader to check if the output is expected.
-///
-/// # TODO
-///
-/// This fuzzer only generate valid operations.
-///
-/// In the future, we need to generate invalid operations to check if we
-/// handled correctly.
-pub struct ObjectReaderFuzzer {
-    name: String,
-    bs: Vec<u8>,
-
-    offset: usize,
-    size: usize,
-    cur: usize,
-    rng: ThreadRng,
-    actions: Vec<ObjectReaderAction>,
+pub struct Fixture {
+    pub paths: Mutex<Vec<String>>,
 }
 
-#[derive(Debug, Clone, Copy)]
-pub enum ObjectReaderAction {
-    Read(usize),
-    Seek(SeekFrom),
-    Next,
-}
-
-impl ObjectReaderFuzzer {

Review Comment:
   Yep, we should run fuzz in a seperate target instead in behavior tests. The 
working loop will be:
   
   - Running fuzzing target
   - Extract fuzz cases into behavior tests
   - Fix the this case
   
   Running a fuzz blinding doesn't make sense.



##########
core/tests/behavior/utils.rs:
##########
@@ -110,255 +103,89 @@ macro_rules! blocking_trials {
     };
 }
 
-/// ObjectReaderFuzzer is the fuzzer for object readers.
-///
-/// We will generate random read/seek/next operations to operate on object
-/// reader to check if the output is expected.
-///
-/// # TODO
-///
-/// This fuzzer only generate valid operations.
-///
-/// In the future, we need to generate invalid operations to check if we
-/// handled correctly.
-pub struct ObjectReaderFuzzer {
-    name: String,
-    bs: Vec<u8>,
-
-    offset: usize,
-    size: usize,
-    cur: usize,
-    rng: ThreadRng,
-    actions: Vec<ObjectReaderAction>,
+pub struct Fixture {
+    pub paths: Mutex<Vec<String>>,
 }
 
-#[derive(Debug, Clone, Copy)]
-pub enum ObjectReaderAction {
-    Read(usize),
-    Seek(SeekFrom),
-    Next,
-}
-
-impl ObjectReaderFuzzer {

Review Comment:
   Yep, we should run fuzz in a seperate target instead in behavior tests. The 
working loop will be:
   
   - Running fuzzing target
   - Extract fuzz cases into behavior tests
   - Fix the this case
   
   Running a fuzz blindly doesn't make sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to