google / google/go-tpm-tools

[KeyManager] Fix parallel tests

Open
#692 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
309
Forks
118
Avg merge
1d 16h
Merged PRs (30d)
33

Description

Ref the code in https://github.com/NilanjanDaw/go-tpm-tools/blob/e114666a20893802fd44ab85b7402d3dc90f4f68/keymanager/workload_service/server_test.go#L1028-L1031
```go
oldTimeout := ClaimsResponseTimeout
ClaimsResponseTimeout = 10 * time.Millisecond
defer func() { ClaimsResponseTimeout = oldTimeout }()
```
Based on comment https://github.com/google/go-tpm-tools/pull/681#discussion_r2888714738 if we ever add t.Parallel() it could result in flaky tests.

In future we can make this configurable field in Server struct

Contributor guide

Open the contributing guide

Research direction

Start with keymanager/workload_service/server_test.go around lines 1028-1031 and review the ClaimsResponseTimeout setup. Check the discussion on pull request 681 for the parallel-test concern, then make the timeout handling safe for parallel tests and verify the affected test behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.