一句话:FlakeSync 自动识别异步 flaky 测试中的同步点并生成补丁,修复时序导致的随机失败。
flaky 测试在同一代码版本上会随机通过或失败,误导开发者对代码正确性的判断。异步 flaky 测试是一类常见情况:测试异步等待另一并行计算完成,并假设其会在特定时间内完成,但时序偏差会导致意外失败。FlakeSync 通过识别测试执行中需要同步的关键点来修复这类测试:它修改代码以记录关键点是否已执行,并让测试等待该事件发生,从而保证正确同步。FlakeSync 不仅定位需要同步的位置,还能自动生成实现必要修改的补丁。该工具以 Maven 插件形式实现,可集成到任意 Maven 项目中,并已公开于 GitHub,同时提供演示视频。摘要未报告定量评估结果。
We present FlakeSync, a tool to automatically repair async flaky tests. Flaky tests can nondeterministically pass or fail when run on the same version of code, misleading developers about the correctness of their code. Async flaky tests are a common type of flaky test in which the test execution asynchronously waits for another parallel computation to complete before proceeding. With an asynchronous wait, the test assumes the other computation will complete within a specific amount of time. However, when the timing is off, the test can fail unexpectedly. FlakeSync repairs async flaky tests by identifying the points during test execution that need to be synchronized to ensure the proper execution. By modifying the code to record when a critical point has been executed and making the test wait until that event occurs, we can ensure proper synchronization. We implement FlakeSync as a Maven plugin, allowing it to be integrable into any Maven project. FlakeSync not only identifies the points that need synchronization during the test execution but also automatically generates a patch implementing the necessary changes for synchronizing the two points. FlakeSync is publicly available on GitHub, and we provide a demo video: https://www.youtube.com/watch?v=gRSFtsO5qm4.