Review Club - fuzz: Abort if system time is called without mock time being set #97
Replies: 1 comment
-
What is fuzzing and Why is it used ?It is a way of testing just like unit/functional tests . It is used to stress test the applications on edge cases that might have been missed and could have caused errors or issues. What is stability in fuzz tests ?It is measured by the reproducibility of the outcomes of the inputs we give. For a set of inputs I should get the same output 100% of the times. If this is not the case , we deem the test to be on a unstable side. Why replacing Systemtime is important for stability of fuzz tests?Invoking Systemtime to create mock_time in fuzz tests was the cause of instability of the fuzz tests , since system_time can vary in various devices and was affecting the reproducibility of bug/crash reports. How is SetMockTime() improving the stability of the fuzz tests?It is ensuring the mocktime is created independent of the time of the device and should be relative to when the test has started. This ensures the results dont depend on this external factor making the test stable. How is the code Identifying the pieces of code using Systemtime in there code ?Whenever the systemtime is called a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Session Details
Date: 01-01-2025
Time: IST 20:00 (UTC 14:30)
Link: PR #31549
Difficulty: Medium
Motivation:
This PR expands the CheckGlobals utility that was introduced in bitcoin/bitcoin#31486 and should help with fuzz stability (bitcoin/bitcoin#29018).
System time shouldn't be used when running a fuzz test, as it is likely to introduce instability (non-determinism). This PR identifies and fixes the targets that were calling system time without setting mock time at the start of an iteration.
RemovingSetMockTime() from any one of these targets should result in a crash and a message describing the issue.
Questions:
Systemtimeis important for stability of fuzz tests?SetMockTime()improving the stability of the fuzz tests?Systemtimein there code ?Learnings:
tests
fuzz
Beta Was this translation helpful? Give feedback.
All reactions