From aef61622aeddc0a62279440e4823fbf3f1793cbb Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 14 May 2025 10:50:10 +0300 Subject: [PATCH] e2e: dra: implement ResetGRPCCalls --- test/e2e/dra/test-driver/app/kubeletplugin.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/e2e/dra/test-driver/app/kubeletplugin.go b/test/e2e/dra/test-driver/app/kubeletplugin.go index 20d4ea119c8..67dfe7ec452 100644 --- a/test/e2e/dra/test-driver/app/kubeletplugin.go +++ b/test/e2e/dra/test-driver/app/kubeletplugin.go @@ -504,6 +504,15 @@ func (ex *ExamplePlugin) GetGRPCCalls() []GRPCCall { return calls } +// ResetGRPCCalls clears the internal tracking of GRPC calls made to the plugin. +// This is useful in tests to start with a clean slate when verifying plugin +// registration behavior, particularly when testing registration retry scenarios. +func (ex *ExamplePlugin) ResetGRPCCalls() { + ex.mutex.Lock() + defer ex.mutex.Unlock() + ex.gRPCCalls = nil +} + // CountCalls counts GRPC calls with the given method suffix. func (ex *ExamplePlugin) CountCalls(methodSuffix string) int { count := 0