Conversation
Summary of ChangesHello @NTaylorMullen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to address flakiness observed in Windows hook tests by refactoring how external script commands are executed within the test suite. By moving inline Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: -56 B (0%) Total Size: 24.4 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request is a solid refactoring effort aimed at improving the stability of integration tests, particularly on Windows. The changes primarily involve moving inline node -e commands into separate script files, which is an effective strategy to avoid shell quoting issues across different platforms. The introduction of the createScript and normalizePath helpers in the test rig, along with increased timeouts for Windows CI, are all positive steps towards reducing test flakiness. The consistent addition of sequential: true to hook definitions in tests is also a good practice to ensure deterministic execution and prevent race conditions. Overall, the changes are well-implemented and directly address the goal of improving test reliability.
- Increase default timeout for TestRig.run and TestRig.runCommand to 10 minutes on Windows CI to handle slow environments. - Replace inline 'node -e' hook commands with script files to avoid brittle quoting and escaping issues on Windows shells. - Add 'TestRig.createScript' helper to simplify script creation in tests. - Fix path escaping for hook output files in 'hooks-agent-flow.test.ts' using JSON.stringify. - Ensure 'TestRig.setup' is called before performing file operations in tests.
- Refactored remaining hook tests in hooks-system.test.ts to use 'rig.createScript' and forward slashes for cross-platform path compatibility. - Replaced 'node -e' usages with script files to avoid brittle quoting and escaping issues on Windows shells. Part of #18665
- Enforce 'sequential: true' for all hook tests to prevent telemetry leaks and race conditions. - Normalize all path assertions in hooks-system.test.ts using a new 'normalizePath' helper to handle Windows backslashes consistently. - Update 'createScript' in test-rig to return normalized paths. - Ensure 'PATH' is explicitly passed to node-pty spawn options to prevent 'posix_spawnp' errors in some environments. - Clean up manual path replacements in tests in favor of the centralized helper. Part of #18665
- Ensure 'SystemRoot', 'COMSPEC', 'windir', and 'PATHEXT' are passed to node-pty on Windows to prevent 'posix_spawnp' failures. - Clean up test directories in 'TestRig.setup' to ensure a fresh state for retries and prevent telemetry log accumulation (fixing the 1, 2, 3 failure pattern). - Fix path normalization in 'Hook Disabling' test to ensure disabled hooks are correctly matched on Windows. Part of #18665
c873ed0 to
cbb09bb
Compare
…eep and increase retries
Summary
Reproduction of Windows hook test flakiness.
Details
This PR modifies the CI workflow to run only
hooks-system.test.tson Windows to isolate failures.Related Issues
Related to #18665
How to Validate
Watch the CI run.
Pre-Merge Checklist