0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
Commit Graph

5 Commits

Author SHA1 Message Date
Harry Waye
1e6c062095
feat(plugin-server): distribute scheduled tasks i.e. runEveryX (#13124)
* chore(plugin-server): disrtibute scheduled tasks

Changes I've made here from the original PR:

 1. add some logging of task run times
 2. add concurrency, except only one task of a plugin will run at a time
 3. add a timeout to task run times

This reverts commit 23db43a0dc.

* chore: add timings for scheduled tasks runtime

* chore: add timeouts for scheduled tasks

* chore: clarify duration unit

* chore: deduplicate tasks in a batch, add partition concurrency

* chore: add flag to switch between old and new behaviour

This defaults to new, but can be set to old by setting environment
variable `USE_KAFKA_FOR_SCHEDULED_TASKS=false`

* fix tests

* enable USE_KAFKA_FOR_SCHEDULED_TASKS in tests
2022-12-05 12:30:52 +00:00
Harry Waye
3c057e9fbd
ci(plugin-server): fix functional tests running forever (#13033)
* ci(plugin-server): fix functional tests running forever

Seems that one of the changes I made resulted in the tests running
forever in GitHub Actions.

* make sure pino transport closed in workers
2022-11-30 13:43:36 +00:00
Harry Waye
0869801a8e
chore(plugin-server): split functional tests into feature based files (#13031)
* chore(plugin-server): split functional tests into feature based files

This is intended to make it more obvious what we are testing, and to try
and identify the major themes of the plugin-server functionality.

As a by product it should make things more parallelizable for jest as
the tests in different files will be isolated, runnable in separate
workers.

* use random api token, avoid db constraints

* make tests silent

* format

* chore: set number of jest workers

These tests should be pretty light given they just hit other APIs and
don't do much themselves. Memory could be an issue on constrained
environments. We shall see.
2022-11-30 12:49:17 +00:00
Harry Waye
4601bf7f32
ci(plugin-server): fun functional tests in parallel (#12582)
* ci(plugin-server): fun functional tests in parallel

By running the tests in parallel we should be able to keep test times
pretty low. The only test that is a little awkward is the
`runEveryMinute` 🤔 maybe we can do some something else for this
test.

* run migrations with test = true

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2022-11-02 21:49:37 +00:00
Harry Waye
cb771f10d3
ci(plugin-server): add coverage output to plugin-server functional tests (#12361)
Doesn't try to do any comparison to base yet although that would be
great, but as it stands it offers some useful insights into where we
might be missing coverage.
2022-10-20 11:11:05 +01:00