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


##########
core/fuzz/fuzz_writer.rs:
##########
@@ -32,11 +32,15 @@ const MAX_DATA_SIZE: usize = 16 * 1024 * 1024;
 #[derive(Debug, Clone)]
 struct FuzzInput {
     actions: Vec<WriteAction>,
+    concurrent: usize,
+    buffer: usize,
 }
 
 impl Arbitrary<'_> for FuzzInput {
     fn arbitrary(u: &mut Unstructured<'_>) -> arbitrary::Result<Self> {
         let mut actions = vec![];
+        let concurrent = u.int_in_range(0..=16)?;

Review Comment:
   As previously stated, I anticipate a 50% allocation for the non-concurrent 
test. Therefore, we should initially select between concurrent and 
non-concurrent, and then choose a random value for current in the event of a 
concurrent scenario.



##########
core/fuzz/fuzz_writer.rs:
##########
@@ -32,11 +32,15 @@ const MAX_DATA_SIZE: usize = 16 * 1024 * 1024;
 #[derive(Debug, Clone)]
 struct FuzzInput {
     actions: Vec<WriteAction>,
+    concurrent: usize,
+    buffer: usize,
 }
 
 impl Arbitrary<'_> for FuzzInput {
     fn arbitrary(u: &mut Unstructured<'_>) -> arbitrary::Result<Self> {
         let mut actions = vec![];
+        let concurrent = u.int_in_range(0..=16)?;
+        let buffer = u.int_in_range(2 * 1024 * 1024..=8 * 1024 * 1024)?;

Review Comment:
   For the buffer, we should allocate 50% for cases without a buffer. Perhaps 
we could test the buffer using `1..=8 * 1024 * 1024` to cover more extreme 
scenarios?



##########
core/fuzz/fuzz_writer.rs:
##########
@@ -32,11 +32,15 @@ const MAX_DATA_SIZE: usize = 16 * 1024 * 1024;
 #[derive(Debug, Clone)]
 struct FuzzInput {
     actions: Vec<WriteAction>,
+    concurrent: usize,

Review Comment:
   How about using `Option<usize>` to give us a 50% chance of testing the 
non-concurrent write case?



##########
core/fuzz/fuzz_writer.rs:
##########
@@ -32,11 +32,15 @@ const MAX_DATA_SIZE: usize = 16 * 1024 * 1024;
 #[derive(Debug, Clone)]
 struct FuzzInput {
     actions: Vec<WriteAction>,
+    concurrent: usize,
+    buffer: usize,

Review Comment:
   The same. By the way, how about moving `buffer` before than `concurrent`?



-- 
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