Skip to content

Commit

Permalink
attempt to solve timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zh committed Dec 31, 2024
1 parent e089e62 commit a878208
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions registry/client_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ func getSortedKids(ctx context.Context, jsonStr string) ([]string, error) {
func TestServeNamespaceRegistry(t *testing.T) {
ctx, cancel, egrp := test_utils.TestContext(context.Background(), t)
t.Cleanup(func() {
func() { require.NoError(t, egrp.Wait()) }()
if r := recover(); r != nil {
t.Errorf("Test panicked: %v", r)
}

cancel()
config.ResetIssuerJWKPtr()
config.ResetIssuerPrivateKeys()
assert.NoError(t, egrp.Wait())
server_utils.ResetTestState()
})
server_utils.ResetTestState()
Expand Down Expand Up @@ -214,16 +216,18 @@ func TestMultiPubKeysRegisteredOnNamespace(t *testing.T) {
ctx, cancel, egrp := test_utils.TestContext(context.Background(), t)
server_utils.ResetTestState()
t.Cleanup(func() {
func() { require.NoError(t, egrp.Wait()) }()
if r := recover(); r != nil {
t.Errorf("Test panicked: %v", r)
}

cancel()
config.ResetIssuerJWKPtr()
config.ResetIssuerPrivateKeys()
assert.NoError(t, egrp.Wait())
server_utils.ResetTestState()
})

tDir := t.TempDir()

svr := registryMockup(ctx, t, "serveregistry")
svr := registryMockup(ctx, t, "MultiPubKeysRegisteredOnNamespace")
defer func() {
err := ShutdownRegistryDB()
assert.NoError(t, err)
Expand Down Expand Up @@ -309,6 +313,10 @@ func TestRegistryKeyChainingOSDF(t *testing.T) {

ctx, cancel, egrp := test_utils.TestContext(context.Background(), t)
t.Cleanup(func() {
if r := recover(); r != nil {
t.Errorf("Test panicked: %v", r)
}

cancel()
assert.NoError(t, egrp.Wait())
server_utils.ResetTestState()
Expand Down Expand Up @@ -410,6 +418,10 @@ func TestRegistryKeyChaining(t *testing.T) {

ctx, cancel, egrp := test_utils.TestContext(context.Background(), t)
t.Cleanup(func() {
if r := recover(); r != nil {
t.Errorf("Test panicked: %v", r)
}

cancel()
assert.NoError(t, egrp.Wait())
server_utils.ResetTestState()
Expand Down

0 comments on commit a878208

Please sign in to comment.