Skip to content

[tests] Fix flakey TestAgentRegistersSessionsWithSessionTracker test.#2252

Merged
aaronlehmann merged 1 commit into
moby:masterfrom
cyli:fix-agent-session-tracker-test
Jun 14, 2017
Merged

[tests] Fix flakey TestAgentRegistersSessionsWithSessionTracker test.#2252
aaronlehmann merged 1 commit into
moby:masterfrom
cyli:fix-agent-session-tracker-test

Conversation

@cyli
Copy link
Copy Markdown
Contributor

@cyli cyli commented Jun 13, 2017

In agent.go, the ready channel is closed before the agent session tracker, if any, gets notified that a session is established. This would periodically cause TestAgentRegistersSessionsWithSessionTracker to fail because it would wait until the node was ready and then see if the tracker had been notified, and sometimes that happened in the reverse order.

This PR also injects the testCA's context into all the agent calls so that better logging can be included.

Signed-off-by: Ying Li ying.li@docker.com

The other option as opposed to polling in the test is, in the agent, to make the session tracker get called before the ready channel is closed, but perhaps closing the channel as soon as the agent was ready rather than waiting on any tracker code, which may be slow, might be better?

Fixes #2225.

…cker,

if any, gets notified that a session is established.  This would
periodically cause TestAgentRegistersSessionsWithSessionTracker to fail
because it would wait until the node was ready and then see if the tracker
had been notified, and sometimes that happened in the reverse order.

This PR also injects the testCA's context into all the agent calls so that
better logging can be included.

Signed-off-by: Ying Li <ying.li@docker.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 14, 2017

Codecov Report

Merging #2252 into master will decrease coverage by 6.17%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2252      +/-   ##
==========================================
- Coverage   66.63%   60.46%   -6.18%     
==========================================
  Files          92      124      +32     
  Lines       13480    20248    +6768     
==========================================
+ Hits         8983    12243    +3260     
- Misses       3550     6635    +3085     
- Partials      947     1370     +423

@aaronlehmann
Copy link
Copy Markdown
Collaborator

LGTM

@aaronlehmann aaronlehmann merged commit 8bab2d6 into moby:master Jun 14, 2017
@cyli cyli deleted the fix-agent-session-tracker-test branch June 14, 2017 00:59
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.

Flakey test TestAgentRegistersSessionsWithSessionTracker

2 participants