Skip to content
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

Added unit test to ensure watches are not re-triggered on consul reload #7449

Conversation

pierresouchay
Copy link
Contributor

@pierresouchay pierresouchay commented Mar 13, 2020

This ensures no regression about #7318

And ensure that #7446 cannot happen anymore

@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch from 6bf7a7c to 3560258 Compare March 13, 2020 15:17
tmpFileRaw, err := ioutil.TempFile("", "rexec")
if err != nil {
t.Fatalf("failed to make tmp file: %#v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

defer os.Remove(tmpFileRaw)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if does no take a file descriptor, only a path: https://golang.org/pkg/os/#Remove, so I think I am correct

dc1 := "dc1"
checkInterval := "1s" // This value ensure we could detect as transient critical state
tmpFileRaw, err := ioutil.TempFile("", "rexec")
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

opt: these can be require.NoError(t, err)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DONE

@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch 2 times, most recently from ec77f48 to 892e23b Compare March 17, 2020 17:55
@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch 2 times, most recently from c33b3cc to 6986079 Compare March 27, 2020 09:37
@pierresouchay
Copy link
Contributor Author

damned unstable integration tests

@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch 3 times, most recently from dbbc930 to ade8d53 Compare March 27, 2020 20:30
@hanshasselberg hanshasselberg self-assigned this Apr 1, 2020
@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch from ade8d53 to 9d1b832 Compare April 3, 2020 07:58
@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch 3 times, most recently from 0a4fcc9 to 52ec09e Compare April 3, 2020 08:51
@pierresouchay pierresouchay force-pushed the unit_test_for_watch_with_agent_reload branch from 52ec09e to c14cfda Compare April 3, 2020 09:19
Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

LGTM

@hanshasselberg hanshasselberg merged commit 5c7af90 into hashicorp:master May 20, 2020
rboyer pushed a commit that referenced this pull request Jun 1, 2020
…ul reload (#7449)

This ensures no regression about #7318
And ensure that #7446 cannot happen anymore
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.

3 participants