apiserver/pkg/storage/testing
Lukasz Szaszkiewicz 0946a0336e apiserver/storage/cacher: decrease the running time of tests in the cacher package.
It turns out that kube has a custom timeout for tests of 3 minutes.
The tests in the cacher package are utilizing nearly the
entire time and are being terminated, resulting in failing jobs.

Before the change, the TestWatchSemantics took ~43s to run. With this simple change, it now takes ~18s.

When we created the tests, we didn't measure the running time and assumed that waiting 1 second on a watch channel
to make sure no more events are received was sufficient.
This PR decreases the waiting time to 300 milliseconds.
Modern computers can perform many tasks within that time.
In addition to that, the tests are serial in nature, meaning that there is no other
actor that could add items to the database, which could result in receiving new items.

After the change the total running time decreased by 17%.
Before the tests needed ~176s after they need ~146s.
The changes also improved TestWatchSemanticInitialEventsExtended.

Kubernetes-commit: d9ca300598e7195545ca38ab9e5e640a2379d553
2024-03-12 09:15:55 +01:00
..
OWNERS OWNERS cleanup - Jan 2021 Week 1 2022-01-03 10:59:47 -05:00
store_tests.go Cleanup paging parameters in etcd3 store 2023-10-20 15:38:59 +02:00
utils.go Ensure that initial events are sorted for WatchList 2023-09-26 18:39:44 +02:00
watcher_tests.go apiserver/storage/cacher: decrease the running time of tests in the cacher package. 2024-03-12 09:15:55 +01:00