Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libs/go/sia/access/tokens: fix dropped test errors #2423

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libs/go/sia/access/tokens/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func TestToBeRefreshed(t *testing.T) {
err = os.WriteFile(tpath, token(360, currentUnixTime), 0400)
require.Nilf(t, err, fmt.Sprintf("should be able to create token: %s", tpath))
err = os.Chtimes(tpath, time.Now(), time.Now().Add(-time.Minute*90))
require.NoError(t, err, "error changing os time on file %q: %v", tpath, err)

tpath = filepath.Join(tokenDir, domain, "reader-fail1")
log.Printf("Creating a token at: %s\n", tpath)
Expand Down Expand Up @@ -212,7 +213,7 @@ func TestToBeRefreshedWithStoreOption(t *testing.T) {
err = os.WriteFile(tpath, token(360000, currentUnixTime), 0400)
require.Nilf(t, err, fmt.Sprintf("should be able to create token: %s", tpath))
err = os.Chtimes(tpath, time.Now(), time.Now().Add(-time.Minute*90))

require.NoError(t, err, "error changing os time on file %q: %v", tpath, err)
opts := config.TokenOptions{
TokenDir: tokenDir,
Tokens: tokens,
Expand Down Expand Up @@ -749,6 +750,7 @@ func TestTokenRefreshOption(t *testing.T) {
siaDir := "/tmp"

opts, err := options.NewOptions(cfg, configAccount, nil, siaDir, "1.0.0", false, "us-west-2")
require.NoError(t, err, "error creating new options: %v", err)
tokenOpts, err := NewTokenOptions(opts, ztsServer.baseUrl("zts/v1"), "mock-ua")
require.Nilf(t, err, "error should not be thrown, error: %v", err)
dur, _ := time.ParseDuration(DefaultRefreshDuration)
Expand Down