Knative common packages
Go to file
Antoine Cotten c56f5e203b
Reduce delays in controller tests (#1603)
* TestEnqueue: remove unnecessary calls to Sleep

The rate limiter applies only when multiple items are put onto the
workqueue, which is not the case in those tests.

Execution: ~7.6s -> ~2.1s

* TestEnqueueAfter: remove assumptions on execution times

Instead of sleeping for a conservative amount of time, keep watching the
state of the workqueue in a goroutine, and notify the test logic as soon
as the item is observed.

Execution: ~1s -> ~0.05s

* TestEnqueueKeyAfter: remove assumptions on execution times

Instead of sleeping for a conservative amount of time, keep watching the
state of the workqueue in a goroutine, and notify the test logic as soon
as the item is observed.

Execution: ~1s -> ~0.05s

* TestStartAndShutdownWithErroringWork: remove sleep

Instead of sleeping for a conservative amount of time, keep watching the
state number of requeues in a goroutine, and notify the test logic as
soon as the expected threshold is reached.

Logs, for an idea of timings
----------------------------
Started workers
Processing from queue bar (depth: 0)
Reconcile error {"error": "I always error"}
Requeuing key bar due to non-permanent error (depth: 0)
Reconcile failed. Time taken: 104µs     {"knative.dev/key": "bar"}
Processing from queue bar (depth: 0)
Reconcile error {"error": "I always error"}
Requeuing key bar due to non-permanent error (depth: 0)
Reconcile failed. Time taken: 48.2µs    {"knative.dev/key": "bar"}

Execution: ~1s -> ~0.01s

* TestStart*/TestRun*: reduce sleep time

There is no need to sleep for that long. If an error was returned, it
would activate the second select case immediately.

Execution: ~1s -> ~0.05s

* TestImplGlobalResync: reduce sleep time

We know the fast lane is empty in this test, so we can safely assume
immediate enqueuing of all items on the slow lane.

Logs, for an idea of timings
----------------------------
Started workers
Processing from queue foo/bar (depth: 0)
Reconcile succeeded. Time taken: 11.5µs {"knative.dev/key": "foo/bar"}
Processing from queue bar/foo (depth: 1)
Processing from queue fizz/buzz (depth: 0)
Reconcile succeeded. Time taken: 9.7µs  {"knative.dev/key": "fizz/buzz"}
Reconcile succeeded. Time taken: 115µs  {"knative.dev/key": "bar/foo"}
Shutting down workers

Execution: ~4s -> ~0.05s

* review: Replace for/select with PollUntil

* review: Remove redundant duration multiplier

* review: Replace defer with t.Cleanup
2020-08-26 10:09:06 -07:00
.github Remove the extraneous templates from pkg (#1644) 2020-08-24 09:53:48 -07:00
apiextensions use apiextensions v1 apis for migrator (#1445) 2020-06-24 11:28:27 -07:00
apis Add a test to verify #542 is not an issue (#1646) 2020-08-24 10:52:47 -07:00
changeset Some cleanups to the changeset code (#577) 2019-08-15 11:22:08 -07:00
client/injection Generate Informer injection for coordination/v1 (#1636) 2020-08-20 11:12:14 -07:00
codegen don't pre/post process if skipstatusupdate (#1625) 2020-08-15 08:51:06 -07:00
configmap Switch bool parsing to the real parser (#1651) 2020-08-25 18:35:06 -07:00
controller Reduce delays in controller tests (#1603) 2020-08-26 10:09:06 -07:00
hack Generate Informer injection for coordination/v1 (#1636) 2020-08-20 11:12:14 -07:00
hash found another way to get repo name in gh actions (#1622) 2020-08-14 18:48:06 -07:00
injection Inject the config into the context. (#1610) 2020-08-11 16:18:05 -07:00
kflag Add flags to disable chaos per-component and configure period. (#1487) 2020-07-14 09:30:19 -07:00
kmeta Make UnionMaps variadic! (#1360) 2020-05-26 19:47:49 -07:00
kmp Various cleanups around the codebase (#1630) 2020-08-17 19:11:13 -07:00
kvstore Introduce key/value store interface + cm backed version of it. (#1173) 2020-03-24 16:06:09 -07:00
leaderelection Fix the test for go 1.15 (#1574) 2020-07-30 17:51:01 -07:00
logging Some minor test coverage improvements and code flow improvements (#1649) 2020-08-24 15:46:47 -07:00
metrics Fix the the request logging boolean toggle (#1648) 2020-08-24 17:50:48 -07:00
network Add a method to set possible maxidle params on the transport. (#1557) 2020-07-24 14:10:57 -07:00
pool add self to aliases and add reviewers to OWNERS (#1409) 2020-06-22 12:30:27 -07:00
profiling Switch to the atomic bool from uber package (#1595) 2020-08-07 22:31:28 -07:00
ptr Add helpers for float pointers. (#1559) 2020-07-27 01:13:59 -07:00
reconciler Give table test some love it sorely misses (#1573) 2020-07-30 16:14:00 -07:00
resolver Change %v to %w in errors and other nits (#1252) 2020-04-27 15:04:51 -07:00
signals Revert "Add SIGPIPE signal handler to the signals package (#689)" (#709) 2019-09-20 13:33:05 -07:00
source add source metrics to report general errors and timeout (#1283) 2020-05-13 10:29:58 -07:00
system Filter tracked sharedmain ConfigMaps based on optional label selector (#973) 2020-01-13 06:53:04 -08:00
test Wait for processes to exit during cleanup (#1203) 2020-08-24 11:21:48 -07:00
testing Clean context.TODO in pkg and other minor nits (#1337) 2020-05-15 10:58:02 -07:00
testutils Various cleanups around the codebase (#1630) 2020-08-17 19:11:13 -07:00
third_party/mako Format markdown (#618) 2019-08-29 07:09:45 -07:00
tracing Allow to specify service name and endpoint IP respectively for zipkin tracing (#1353) 2020-08-03 10:35:02 -07:00
tracker Fix \" escaping and other nits in the pkg (#1339) 2020-05-16 09:36:02 -07:00
vendor [master] Auto-update dependencies (#1650) 2020-08-25 09:26:47 -07:00
version bump k8s min version to 1.16.0 (#1455) 2020-06-30 07:50:30 -07:00
webhook Various cleanups around the codebase (#1630) 2020-08-17 19:11:13 -07:00
websocket Add SendRaw to websocket client (#1396) 2020-06-09 06:59:32 -07:00
.gitattributes Enable coverage for test code (#778) 2019-10-21 12:37:24 -07:00
.gitignore [Genreconciler] Fix group names when client groups differ than their directory name. (#1097) 2020-02-18 17:14:59 -08:00
CONTRIBUTING.md Copy over some of the core markdown from serving. (#2) 2018-07-25 10:44:49 -07:00
DEVELOPMENT.md use https style vs. ssh (#1202) 2020-04-14 12:04:16 -07:00
LICENSE Initial commit 2018-07-25 10:16:04 -07:00
OWNERS Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
OWNERS_ALIASES Add vagababov as productivity approver (#1551) 2020-07-23 10:28:57 -07:00
README.md Format markdown (#189) 2018-12-04 14:14:25 -08:00
RELEASE-LEADS.md Document repos without deps on seving or eventing (#1633) 2020-08-18 15:36:13 -07:00
code-of-conduct.md Format markdown (#189) 2018-12-04 14:14:25 -08:00
go.mod [master] Auto-update dependencies (#1650) 2020-08-25 09:26:47 -07:00
go.sum [master] Auto-update dependencies (#1650) 2020-08-25 09:26:47 -07:00

README.md

Knative Common Packages

GoDoc Go Report Card

Knative pkg provides a place for sharing common Knative packages across the Knative repos.

To learn more about Knative, please visit our Knative docs repository.

If you are interested in contributing, see CONTRIBUTING.md and DEVELOPMENT.md.