Skip to content

test: fix flaky TestCreateValidateRichParameters/ValidateString #9928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Sep 29, 2023

Spotted in: https://github.com/coder/coder/actions/runs/6328948621/job/17188404038

    ptytest.go:131: 2023-09-27 16:54:38.747: cmd: "string_parameter"
    create_test.go:448: 2023-09-27 16:54:38.749: cmd: matched "string_parameter" = "string_parameter"
    create_test.go:449: 2023-09-27 16:54:38.749: cmd: stdin: "$$\r\n"
    ptytest.go:131: 2023-09-27 16:54:38.749: cmd: "> Enter a value (default: \"\"): can't validate build parameter \"string_parameter\": this is error (value \"$$\" does not match \"^[a-z]+$\")"
    create_test.go:448: 2023-09-27 16:54:38.749: cmd: matched "does not match" = "\n> Enter a value (default: \"\"): can't validate build parameter \"string_parameter\": this is error (value \"$$\" does not match"
    create_test.go:449: 2023-09-27 16:54:38.750: cmd: stdin: "\r\n"
    create_test.go:448: 2023-09-27 16:54:38.750: cmd: matched "Enter a value" = " \"^[a-z]+$\")\n> Enter a value"
    create_test.go:449: 2023-09-27 16:54:38.750: cmd: stdin: "abc\r\n"
    ptytest.go:131: 2023-09-27 16:54:38.750: cmd: "> Enter a value (default: \"\"): can't validate build parameter \"string_parameter\": this is error (value \"\" does not match \"^[a-z]+$\")"
    create_test.go:448: 2023-09-27 16:54:58.779: cmd: read error: match deadline exceeded: context deadline exceeded (wanted "Confirm create?"; got " (default: \"\"): can't validate build parameter \"string_parameter\": this is error (value \"\" does not match \"^[a-z]+$\")\n> Enter a value (default: \"\"): ")

An empty string (with \r\n) was treated as input value.

@mtojek mtojek self-assigned this Sep 29, 2023
@mtojek mtojek changed the title fix: flaky TestCreateValidateRichParameters/ValidateString test: fix flaky TestCreateValidateRichParameters/ValidateString Sep 29, 2023
@mtojek mtojek added the hotfix label Sep 29, 2023
@mtojek mtojek marked this pull request as ready for review September 29, 2023 10:54
Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@mtojek mtojek merged commit c0705ec into main Sep 29, 2023
@mtojek mtojek deleted the fix-flaky-create branch September 29, 2023 10:54
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant