Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 9, 2025

The expansion analyzer timeout was hardcoded at 10 seconds. This PR makes it configurable via CLI flags and test parameters, with a 100ms default for tests to keep them fast.

Changes

Core API

  • source-analyze now requires #:timeout-ms parameter (was hardcoded at 10000ms)
  • resyntax-analyze and resyntax-analyze-all accept optional #:timeout-ms with 10000ms default
  • Timeout logging changed from seconds to milliseconds for precision

CLI

  • Added --analyzer-timeout <ms> flag to resyntax analyze and resyntax fix commands
  • Defaults to 10000ms when unspecified

Test Infrastructure

  • Added current-analyzer-timeout-millis parameter (default: 100ms)
  • Implemented @analyzer-timeout-millis test parameter for test:, no-change-test:, and analysis-test: cases

Example

#lang resyntax/test

test: "fast tests use 100ms default"
- (or 1 (or 2 3))
- (or 1 2 3)

test: "override for complex analysis"
@analyzer-timeout-millis 5000
- (complex-code)
- (refactored-code)

analysis-test: "works with all test types"
@analyzer-timeout-millis 500
- (code)
@inspect - (subform)
@property foo

Command line:

resyntax analyze --file myfile.rkt --analyzer-timeout 15000
resyntax fix --directory src/ --analyzer-timeout 5000
Original prompt

This section details on the original issue you should resolve

<issue_title>Configurable analyzer timeout</issue_title>
<issue_description>The expansion analyzer timeout should be configurable, both at the command line and in analysis-test: cases. It should be passed to source-analyze explicitly as a mandatory keyword argument. The main.rkt Resyntax code should use the same default timeout that source-analyze currently does, but in #lang resyntax/test the timeout should default to something very short, like 100ms. Test cases should be able to specify a longer timeout with an @analyzer-timeout-millis test parameter, like so:

#lang resyntax/test
header: - #lang racket/base

test: "foo"
@analyzer-timeout-millis 500
- (old-code)
- (new-code)

no-change-test: "foo"
@analyzer-timeout-millis 500
- (old-code)

analysis-test: "foo"
@analyzer-timeout-millis 500
- (old-code)
@inspect - old-code
@property bar
@assert baz
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 9, 2025 17:18
Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Co-authored-by: jackfirth <8175575+jackfirth@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configurable analyzer timeout in source-analyze Make analyzer timeout configurable Nov 9, 2025
Copilot AI requested a review from jackfirth November 9, 2025 17:35
@jackfirth jackfirth marked this pull request as ready for review November 9, 2025 18:24
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 6 files in this pull request and found no issues.

@coveralls
Copy link

Pull Request Test Coverage Report for Build #320

Details

  • 61 of 82 (74.39%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 93.63%

Changes Missing Coverage Covered Lines Changed/Added Lines %
main.rkt 17 20 85.0%
test.rkt 8 12 66.67%
cli.rkt 7 21 33.33%
Totals Coverage Status
Change from base Build #317: -0.05%
Covered Lines: 15140
Relevant Lines: 16170

💛 - Coveralls

@jackfirth jackfirth merged commit 186fd5e into master Nov 10, 2025
11 of 12 checks passed
@jackfirth jackfirth deleted the copilot/configurable-analyzer-timeout branch November 10, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable analyzer timeout

3 participants