• Marco Elver's avatar
    kcsan: test: Fix flaky test case · ade3a58b
    Marco Elver authored
    If CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n, then we may also see data
    races between the writers only. If we get unlucky and never capture a
    read-write data race, but only the write-write data races, then the
    test_no_value_change* test cases may incorrectly fail.
    
    The second problem is that the initial value needs to be reset, as
    otherwise we might actually observe a value change at the start.
    
    Fix it by also looking for the write-write data races, and resetting the
    value to what will be written.
    Signed-off-by: default avatarMarco Elver <elver@google.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    ade3a58b
kcsan_test.c 36 KB