Merge pull request #124513 from serathius/workarounds

Remove workarounds for https://github.com/etcd-io/etcd/issues/17507
This commit is contained in:
Kubernetes Prow Robot 2024-04-24 14:29:47 -07:00 committed by GitHub
commit 9c4d207d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 22 deletions

View File

@ -177,13 +177,6 @@ func TestListWithConsistentListFromCache(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ConsistentListFromCache, true)()
ctx, cacher, server, terminate := testSetupWithEtcdServer(t)
t.Cleanup(terminate)
// Wait before sending watch progress request to avoid https://github.com/etcd-io/etcd/issues/17507
// TODO(https://github.com/etcd-io/etcd/issues/17507): Remove the wait when etcd is upgraded to version with fix.
err := cacher.ready.wait(ctx)
if err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
storagetesting.RunTestList(ctx, t, cacher, compactStorage(cacher, server.V3Client), true)
}
@ -198,13 +191,6 @@ func TestConsistentListWithConsistentListFromCache(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ConsistentListFromCache, true)()
ctx, cacher, server, terminate := testSetupWithEtcdServer(t)
t.Cleanup(terminate)
// Wait before sending watch progress request to avoid https://github.com/etcd-io/etcd/issues/17507
// TODO(https://github.com/etcd-io/etcd/issues/17507): Remove the wait when etcd is upgraded to version with fix.
err := cacher.ready.wait(ctx)
if err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
storagetesting.RunTestConsistentList(ctx, t, cacher, compactStorage(cacher, server.V3Client), true, true)
}
@ -219,9 +205,6 @@ func TestGetListNonRecursiveWithConsistentListFromCache(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ConsistentListFromCache, true)()
ctx, cacher, server, terminate := testSetupWithEtcdServer(t)
t.Cleanup(terminate)
// Wait before sending watch progress request to avoid https://github.com/etcd-io/etcd/issues/17507
// TODO(https://github.com/etcd-io/etcd/issues/17507): Remove sleep when etcd is upgraded to version with fix.
time.Sleep(time.Second)
storagetesting.RunTestGetListNonRecursive(ctx, t, compactStorage(cacher, server.V3Client), cacher)
}

View File

@ -2446,9 +2446,8 @@ func TestWatchStreamSeparation(t *testing.T) {
if tc.useWatchCacheContextMetadata {
contextMetadata = cacher.watchCache.waitingUntilFresh.contextMetadata
}
// Wait before sending watch progress request to avoid https://github.com/etcd-io/etcd/issues/17507
// TODO(https://github.com/etcd-io/etcd/issues/17507): Remove sleep when etcd is upgraded to version with fix.
time.Sleep(time.Second)
// For the first 100ms from watch creation, watch progress requests are ignored.
time.Sleep(200 * time.Millisecond)
err = cacher.storage.RequestWatchProgress(metadata.NewOutgoingContext(context.Background(), contextMetadata))
if err != nil {
t.Fatal(err)
@ -2459,13 +2458,13 @@ func TestWatchStreamSeparation(t *testing.T) {
etcdWatchResourceVersion := waitForEtcdBookmark()
gotEtcdWatchBookmark := etcdWatchResourceVersion == lastResourceVersion
if gotEtcdWatchBookmark != tc.expectBookmarkOnEtcd {
t.Errorf("Unexpected etcd bookmark check result, rv: %d, got: %v, want: %v", etcdWatchResourceVersion, etcdWatchResourceVersion, tc.expectBookmarkOnEtcd)
t.Errorf("Unexpected etcd bookmark check result, rv: %d, lastRV: %d, wantMatching: %v", etcdWatchResourceVersion, lastResourceVersion, tc.expectBookmarkOnEtcd)
}
watchCacheResourceVersion := getCacherRV()
cacherGotBookmark := watchCacheResourceVersion == lastResourceVersion
if cacherGotBookmark != tc.expectBookmarkOnWatchCache {
t.Errorf("Unexpected watch cache bookmark check result, rv: %d, got: %v, want: %v", watchCacheResourceVersion, cacherGotBookmark, tc.expectBookmarkOnWatchCache)
t.Errorf("Unexpected watch cache bookmark check result, rv: %d, lastRV: %d, wantMatching: %v", watchCacheResourceVersion, lastResourceVersion, tc.expectBookmarkOnWatchCache)
}
})
}