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

test(discovery): fixes admin controller test intermittent failures #4202

Merged
merged 2 commits into from
Dec 9, 2021

Conversation

guido9j
Copy link
Contributor

@guido9j guido9j commented Dec 9, 2021

Fixes com.netflix.spinnaker.orca.controllers.AdminControllerTest intermittent failures. The failure seems to be caused by a start up issue. The DiscoveryActivator is not initialized when the test is checking for its initial status. This fix adds wait/sleep, so DiscoveryActivator can be fully initialized.

Here is the test log showing failure:
TEST-com.netflix.spinnaker.orca.controllers.AdminControllerTest.xml.log

Here is the partial output of test when it encounters issue, and successful:

2021-12-09T04:09:24.5943329Z 2021-12-09 04:08:58.103 INFO 7552 --- [ Test worker] o.s.t.web.servlet.TestDispatcherServlet : Completed initialization in 239 ms
2021-12-09T04:09:24.5945652Z 2021-12-09 04:08:58.580 WARN 7552 --- [ events-6] c.n.s.k.d.NoDiscoveryStatusPublisher : No service discovery client is available, assuming application is UP
2021-12-09T04:09:24.5948049Z 2021-12-09 04:08:58.606 INFO 7552 --- [ Test worker] c.n.s.o.c.AdminControllerTest$Fixture : Started AdminControllerTest.Fixture in 32.505 seconds (JVM running for 44.683)

// DiscoveryActivator not ready when test starts
2021-12-09T04:09:24.5949692Z discoveryActivator.enabled = false. Sleep 1sec

2021-12-09T04:09:24.5951472Z 2021-12-09 04:08:58.788 INFO 7552 --- [ events-1] c.n.s.k.d.DiscoveryStatusListener : Instance status has changed to UP in service discovery
2021-12-09T04:09:24.5953626Z 2021-12-09 04:08:58.788 INFO 7552 --- [ events-19] c.n.s.q.discovery.DiscoveryActivator : Instance is UP... DiscoveryActivator starting
2021-12-09T04:09:24.5955891Z 2021-12-09 04:08:58.826 INFO 7552 --- [ scheduler-6] s.k.p.u.r.r.RemotePluginInfoReleaseCache : Cached 0 remote plugin configurations.

// After sleeping 1 second, DiscoveryActivator is ready
2021-12-09T04:09:24.5957448Z discoveryActivator.enabled = true. Start

2021-12-09T04:09:24.5959311Z 2021-12-09 04:08:59.838 INFO 7552 --- [ events-4] c.n.s.q.discovery.DiscoveryActivator : Instance is OUT_OF_SERVICE... DiscoveryActivator stopping
2021-12-09T04:09:24.5961573Z 2021-12-09 04:08:59.838 INFO 7552 --- [ events-7] c.n.s.k.d.DiscoveryStatusListener : Instance status has changed to OUT_OF_SERVICE in service discovery

@guido9j
Copy link
Contributor Author

guido9j commented Dec 9, 2021

@dbyron-sf here is a possible fix for that intermittent test failing. There is probably a better way to deal with this, but this is working as far as I can tell.

@dbyron-sf
Copy link
Contributor

I'm going to re-run the job again, and I agree there's likely a better fix, but this feels like progress. Thanks!

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Dec 9, 2021
@mergify mergify bot merged commit f570af6 into spinnaker:master Dec 9, 2021
@mergify mergify bot added the auto merged Merged automatically by a bot label Dec 9, 2021
@guido9j guido9j deleted the test-fix-admin-controller-test branch December 9, 2021 17:50
@dbyron-sf
Copy link
Contributor

@Mergifyio backport release-1.27.x

@mergify
Copy link
Contributor

mergify bot commented Apr 1, 2022

backport release-1.27.x

✅ Backports have been created

mergify bot added a commit that referenced this pull request Apr 1, 2022
#4202) (#4249)

(cherry picked from commit f570af6)

Co-authored-by: guido9j <james_guido@homedepot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.28
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants