Skip to content

Fix actor reminder e2e tests + fixes to reminder partition#4021

Merged
artursouza merged 17 commits into
dapr:masterfrom
artursouza:retry_actor_reminder_restart_e2e
Jan 3, 2022
Merged

Fix actor reminder e2e tests + fixes to reminder partition#4021
artursouza merged 17 commits into
dapr:masterfrom
artursouza:retry_actor_reminder_restart_e2e

Conversation

@artursouza

@artursouza artursouza commented Dec 13, 2021

Copy link
Copy Markdown
Contributor

Description

Fixes the reminder E2E tests.
Fixes to the reminder storage solution with partitioning.

Issue reference

Please reference the issue this PR will close: #3984

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

RELEASE NOTE: Fix logging of conflict when loading actor state store and fixes to actor reminders partitioning.

@artursouza
artursouza requested review from a team as code owners December 13, 2021 01:19
@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@artursouza
artursouza marked this pull request as draft December 13, 2021 01:20
@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-06 for windows. Please check the build status.

@codecov

codecov Bot commented Dec 13, 2021

Copy link
Copy Markdown

Codecov Report

Merging #4021 (a9592e2) into master (f2d77e7) will decrease coverage by 0.21%.
The diff coverage is 64.33%.

❗ Current head a9592e2 differs from pull request most recent head 853021e. Consider uploading reports for the commit 853021e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4021      +/-   ##
==========================================
- Coverage   63.40%   63.18%   -0.22%     
==========================================
  Files         101      101              
  Lines        9581     9652      +71     
==========================================
+ Hits         6075     6099      +24     
- Misses       3032     3074      +42     
- Partials      474      479       +5     
Impacted Files Coverage Δ
pkg/actors/actors.go 64.83% <61.36%> (-2.01%) ⬇️
pkg/runtime/runtime.go 63.61% <100.00%> (-0.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2d77e7...853021e. Read the comment docs.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!

@dapr-bot

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on windows. Thanks for your contribution!

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

@artursouza artursouza changed the title Add retry to fetch logs for actor reminder restart e2e. Add retry to for actor reminder e2e tests. Dec 14, 2021
Comment thread pkg/runtime/runtime.go
diag.DefaultMonitoring.ComponentInitialized(s.Spec.Type)
}

if a.hostingActors() && (a.actorStateStoreName == "" || a.actorStateStoreCount != 1) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This code is executed before sidecar invokes /dapr/config, which means that a.hostingActors() would return false. This was not always like that but we had many changes in the order of loading things in Dapr sidecar and this was a side effect of that.

yaron2
yaron2 previously approved these changes Jan 1, 2022

@yaron2 yaron2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Comment thread tests/e2e/actor_features/actor_features_test.go Outdated
Comment thread tests/runner/kube_testplatform.go Outdated
_, err := appManager.WaitUntilDeploymentState(appManager.IsDeploymentDone)
// 120s is the observed time to spawn a new test app POD and terminate the old one.
// This sleep time is important for the stream log to work.
time.Sleep(120 * time.Second)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems extremely high, and we're already cutting close the 10 minutes limit for some of our test suites. The line below this one should gate this appropriately. If deployment state is running, your logs should stream properly. If you are seeing errors, it might be because the StreamContainerLogs() attempts to run against all pods in a deployment, and might try against a terminated pod, I think? The new pod should still work, even in the presence of this error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This one is needed because it is the time I observed for the new POD to be created and the old one to be terminated. Otherwise, tests can fail because the requests can go to any of the PODs and add flakiness.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So WaitUntilDeploymentState doesn't sufficiently gate on the deployment being completed? Could we just update WaitUntilDeploymentState to also gate on the number of replicas being what we expect?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked the code. It does that already. Let me remove this. Nice catch.

Comment thread tests/runner/kube_testplatform.go Outdated
@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-06 for windows. Please check the build status.

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

Signed-off-by: Artur Souza <[email protected]>
@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!

@wcs1only

wcs1only commented Jan 3, 2022

Copy link
Copy Markdown
Contributor

/ok-to-test

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@wcs1only wcs1only left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for removing the sleeps. LGTM

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@artursouza
artursouza merged commit 1c47694 into dapr:master Jan 3, 2022
@artursouza artursouza added this to the v1.6 milestone Jan 3, 2022
@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

dapr-bot commented Jan 3, 2022

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

x-shadow-man pushed a commit to x-shadow-man/dapr that referenced this pull request Jan 4, 2022
* Fix actor metadata concurrency and reminder E2E tests.
Fix error handling in create/delete reminders with partitioning.
Add more logging to actor reminders.
Fix race condition in e2e app actorfeatures.

Signed-off-by: Artur Souza <[email protected]>

* Fix use of pointer for reminders.

Signed-off-by: Artur Souza <[email protected]>

* handle empty data on reading reminder.

Signed-off-by: Artur Souza <[email protected]>

* Uses strong consistency in all state operations for actors.

Signed-off-by: Artur Souza <[email protected]>

* Use Set instead of Multi for reminder partition.

Signed-off-by: Artur Souza <[email protected]>

* Fix logic on migrating actor type.

Signed-off-by: Artur Souza <[email protected]>

* Use SetAppEnv() to change reminder partition in e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Make actor logs more verbose.

Signed-off-by: Artur Souza <[email protected]>

* Use exponential backoff for reminder actor features e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Sleep on update env for stream log to work.

Signed-off-by: Artur Souza <[email protected]>

* Use k8s Restart on actor reminder restart e2e.

Signed-off-by: Artur Souza <[email protected]>

* Add extra sleep to reminder restart e2 test.

Signed-off-by: Artur Souza <[email protected]>

* More logging, improve read of reminders.

Signed-off-by: Artur Souza <[email protected]>

* Fix root cause of flaky tests for actors.

Signed-off-by: Artur Souza <[email protected]>

* Address PR coments.

Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: x-shadow-man <[email protected]>
x-shadow-man pushed a commit to x-shadow-man/dapr that referenced this pull request Jan 4, 2022
* Fix actor metadata concurrency and reminder E2E tests.
Fix error handling in create/delete reminders with partitioning.
Add more logging to actor reminders.
Fix race condition in e2e app actorfeatures.

Signed-off-by: Artur Souza <[email protected]>

* Fix use of pointer for reminders.

Signed-off-by: Artur Souza <[email protected]>

* handle empty data on reading reminder.

Signed-off-by: Artur Souza <[email protected]>

* Uses strong consistency in all state operations for actors.

Signed-off-by: Artur Souza <[email protected]>

* Use Set instead of Multi for reminder partition.

Signed-off-by: Artur Souza <[email protected]>

* Fix logic on migrating actor type.

Signed-off-by: Artur Souza <[email protected]>

* Use SetAppEnv() to change reminder partition in e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Make actor logs more verbose.

Signed-off-by: Artur Souza <[email protected]>

* Use exponential backoff for reminder actor features e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Sleep on update env for stream log to work.

Signed-off-by: Artur Souza <[email protected]>

* Use k8s Restart on actor reminder restart e2e.

Signed-off-by: Artur Souza <[email protected]>

* Add extra sleep to reminder restart e2 test.

Signed-off-by: Artur Souza <[email protected]>

* More logging, improve read of reminders.

Signed-off-by: Artur Souza <[email protected]>

* Fix root cause of flaky tests for actors.

Signed-off-by: Artur Souza <[email protected]>

* Address PR coments.

Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: x-shadow-man <[email protected]>
x-shadow-man pushed a commit to x-shadow-man/dapr that referenced this pull request Jan 4, 2022
* Fix actor metadata concurrency and reminder E2E tests.
Fix error handling in create/delete reminders with partitioning.
Add more logging to actor reminders.
Fix race condition in e2e app actorfeatures.

Signed-off-by: Artur Souza <[email protected]>

* Fix use of pointer for reminders.

Signed-off-by: Artur Souza <[email protected]>

* handle empty data on reading reminder.

Signed-off-by: Artur Souza <[email protected]>

* Uses strong consistency in all state operations for actors.

Signed-off-by: Artur Souza <[email protected]>

* Use Set instead of Multi for reminder partition.

Signed-off-by: Artur Souza <[email protected]>

* Fix logic on migrating actor type.

Signed-off-by: Artur Souza <[email protected]>

* Use SetAppEnv() to change reminder partition in e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Make actor logs more verbose.

Signed-off-by: Artur Souza <[email protected]>

* Use exponential backoff for reminder actor features e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Sleep on update env for stream log to work.

Signed-off-by: Artur Souza <[email protected]>

* Use k8s Restart on actor reminder restart e2e.

Signed-off-by: Artur Souza <[email protected]>

* Add extra sleep to reminder restart e2 test.

Signed-off-by: Artur Souza <[email protected]>

* More logging, improve read of reminders.

Signed-off-by: Artur Souza <[email protected]>

* Fix root cause of flaky tests for actors.

Signed-off-by: Artur Souza <[email protected]>

* Address PR coments.

Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: x-shadow-man <[email protected]>
Taction added a commit to Taction/dapr that referenced this pull request Jan 4, 2022
* master:
  Saves 'describe' output of K8s resources for E2E tests. (dapr#4082)
  Fix flakiness on get metadata e2e. (dapr#4080)
  Return error instead of crashing when receiving grpc_proxy request on uninitialized daprd
  Fix actor reminder e2e tests + fixes to reminder partition (dapr#4021)
  Upgrading fasthttp to fix shutdown issue
  Fixed create timer duetime
  remove max graceful shutdown duration limit
  fix lint
  add more test case
  fix lint
  Make the grace period configurable

Signed-off-by: Taction <[email protected]>
x-shadow-man pushed a commit to x-shadow-man/dapr that referenced this pull request Jan 5, 2022
* Fix actor metadata concurrency and reminder E2E tests.
Fix error handling in create/delete reminders with partitioning.
Add more logging to actor reminders.
Fix race condition in e2e app actorfeatures.

Signed-off-by: Artur Souza <[email protected]>

* Fix use of pointer for reminders.

Signed-off-by: Artur Souza <[email protected]>

* handle empty data on reading reminder.

Signed-off-by: Artur Souza <[email protected]>

* Uses strong consistency in all state operations for actors.

Signed-off-by: Artur Souza <[email protected]>

* Use Set instead of Multi for reminder partition.

Signed-off-by: Artur Souza <[email protected]>

* Fix logic on migrating actor type.

Signed-off-by: Artur Souza <[email protected]>

* Use SetAppEnv() to change reminder partition in e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Make actor logs more verbose.

Signed-off-by: Artur Souza <[email protected]>

* Use exponential backoff for reminder actor features e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Sleep on update env for stream log to work.

Signed-off-by: Artur Souza <[email protected]>

* Use k8s Restart on actor reminder restart e2e.

Signed-off-by: Artur Souza <[email protected]>

* Add extra sleep to reminder restart e2 test.

Signed-off-by: Artur Souza <[email protected]>

* More logging, improve read of reminders.

Signed-off-by: Artur Souza <[email protected]>

* Fix root cause of flaky tests for actors.

Signed-off-by: Artur Souza <[email protected]>

* Address PR coments.

Signed-off-by: Artur Souza <[email protected]>
Signed-off-by: x-shadow-man <[email protected]>
x-shadow-man pushed a commit to x-shadow-man/dapr that referenced this pull request Jan 5, 2022
* Fix actor metadata concurrency and reminder E2E tests.
Fix error handling in create/delete reminders with partitioning.
Add more logging to actor reminders.
Fix race condition in e2e app actorfeatures.

Signed-off-by: Artur Souza <[email protected]>

* Fix use of pointer for reminders.

Signed-off-by: Artur Souza <[email protected]>

* handle empty data on reading reminder.

Signed-off-by: Artur Souza <[email protected]>

* Uses strong consistency in all state operations for actors.

Signed-off-by: Artur Souza <[email protected]>

* Use Set instead of Multi for reminder partition.

Signed-off-by: Artur Souza <[email protected]>

* Fix logic on migrating actor type.

Signed-off-by: Artur Souza <[email protected]>

* Use SetAppEnv() to change reminder partition in e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Make actor logs more verbose.

Signed-off-by: Artur Souza <[email protected]>

* Use exponential backoff for reminder actor features e2e test.

Signed-off-by: Artur Souza <[email protected]>

* Sleep on update env for stream log to work.

Signed-off-by: Artur Souza <[email protected]>

* Use k8s Restart on actor reminder restart e2e.

Signed-off-by: Artur Souza <[email protected]>

* Add extra sleep to reminder restart e2 test.

Signed-off-by: Artur Souza <[email protected]>

* More logging, improve read of reminders.

Signed-off-by: Artur Souza <[email protected]>

* Fix root cause of flaky tests for actors.

Signed-off-by: Artur Souza <[email protected]>

* Address PR coments.

Signed-off-by: Artur Souza <[email protected]>
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.

[E2E Test failure] Reminder test with >40% failure rate.

4 participants