You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -9,9 +9,7 @@ There are many flaky tests marked as ```DeveloperFixed```. Once you find the fir
9
9
10
10
## Find the commit which fixed the flaky test using Git Bisect
11
11
12
-
Git Bisect command uses a binary search algorithm to find which commit in your project’s history introduced a bug. You use it by first telling it a "bad" commit that is known to contain the bug, and a "good" commit that is known to be before the bug was introduced.
13
-
14
-
The git-bisect-script-alluxio.sh script handles the case where the flaky test is fixed in the latest commit.
12
+
Git Bisect uses a binary search algorithm to find which commit fixed a flaky test. This tool uses custom terminology: "flaky" for the old broken state and "non-flaky" for the new fixed state, making the process more intuitive.
2. Copy scripts `git-bisect-runner.sh` and `git-bisect-script.sh` to the directory of the project containing the fixed flaky test.
23
21
24
-
3. Within the project containing the DeveloperFixed test, run the script using the command below. Modify arguments to specific flaky commit, fixed commit, module path, test case of your project, mvn install options, and NonDex version. This command will also ensure standard error and output messages go to `git_bisect_output.log`, while running command in the background (since using nohup).
22
+
3. Within the project containing the DeveloperFixed test, run the script using the command below.
23
+
24
+
#### Command Format
25
+
26
+
```shell
27
+
./git-bisect-runner.sh \
28
+
--flaky <FLAKY_COMMIT> \
29
+
--fixed <FIXED_COMMIT> \
30
+
--module <MODULE_PATH> \
31
+
--test <TEST_CASE> \
32
+
--nondex-version <NONDEX_VERSION> \
33
+
[--mvn-install <MAVEN_OPTIONS>]
34
+
```
35
+
36
+
#### Argument Details
37
+
38
+
| Argument | Format | Description | Example |
39
+
|----------|--------|-------------|---------|
40
+
|`--flaky`| Git commit hash (full or short) | The commit where the test **was flaky**|`ecf41be2ecd007853c2db19e1c6a038cf356cb9e` or `ecf41be`|
41
+
|`--fixed`| Git commit hash (full or short) | The commit where the test **was fixed**|`f69557e325c5bb9e4e250bb0ec2db12d85298211` or `f69557e`|
42
+
|`--module`| Maven module path | The Maven module containing the test (relative to project root) |`pinot-core` or `server/service`|
43
+
|`--test`| Fully qualified test name | Format: `package.ClassName#methodName` or `package.ClassName`|`org.apache.pinot.queries.QueryTest#testMethod`|
44
+
|`--nondex-version`| Version string | The NonDex Maven plugin version to use |`"2.1.7"` or `"1.1.2"`|
45
+
|`--mvn-install`| Maven CLI options (optional) | Additional Maven options for build |`"-Dspotless.skip"` or `"-Dlicense.skip -DskipTests"`|
46
+
47
+
**Important Notes:**
48
+
-**Module Path**: Use the Maven module identifier (same as `-pl` argument in Maven)
49
+
- For single module projects: use `.` or the module name
50
+
- For multi-module projects: use the relative path like `sub-module/nested-module`
51
+
-**Test Case Format**:
52
+
- Single test method: `com.example.TestClass#testMethodName`
53
+
- Entire test class: `com.example.TestClass`
54
+
-**Commit Hashes**: Both short (7+ chars) and full (40 chars) SHA hashes are acceptable
The output of this execution will give the commit where the flaky test was fixed. Messages within process can be found in log file within project directory.
120
+
**Note:** Command-line arguments will override default values if both are provided.
121
+
### Output
122
+
123
+
The script will:
124
+
1. Display configuration settings
125
+
2. Validate all inputs and commits
126
+
3. Run the bisect process with colored status updates
127
+
4. Show the commit that fixed the flaky test
128
+
5. Display the bisect log
129
+
6. Automatically reset the bisect session
130
+
131
+
### Troubleshooting
132
+
133
+
The script includes built-in error handling, but you can also use these git commands:
134
+
135
+
- Check bisect status: `git bisect log`
136
+
- View current state: `git bisect visualize` or `git bisect view`
137
+
- Manually reset if needed: `git bisect reset`
138
+
139
+
### Exit Codes
34
140
35
-
To check for errors during process, run: `git bisect status`
36
-
To check log as process is running, run: `git bisect log`
37
-
To stop and reset bisect process, run: `git bisect reset`
141
+
-`0`: Test is flaky (old state)
142
+
-`1`: Test is non-flaky (new state)
143
+
-`125`: Build failed, skip this commit (git bisect special code)
0 commit comments