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

panic: fractional second out of range #237

Open
svrnm opened this issue Oct 11, 2024 · 0 comments
Open

panic: fractional second out of range #237

svrnm opened this issue Oct 11, 2024 · 0 comments
Labels

Comments

@svrnm
Copy link

svrnm commented Oct 11, 2024

Describe the bug

after running htmltest wrote the following entry in the refcache:

{"https://example.com":{"StatusCode":200,"LastSeen":"2024-10-07T14:48:00.1728308939Z"}}

When I run htmltest now, it panics with the following error:

htmltest started at 10:08:27 on .
========================================================================
panic: parsing time "\"2024-10-07T14:48:00.1728308939Z\"": fractional second out of range

goroutine 1 [running]:
github.com/wjdp/htmltest/output.CheckErrorPanic(...)
	/home/runner/work/htmltest/htmltest/output/error.go:22
github.com/wjdp/htmltest/refcache.(*RefCache).ReadStore(0x1400011e420, {0x14000137240, 0x1b})
	/home/runner/work/htmltest/htmltest/refcache/refcache.go:48 +0x1d4
github.com/wjdp/htmltest/refcache.NewRefCache({0x14000137240, 0x1b}, {0x100a55d6c, 0x4})
	/home/runner/work/htmltest/htmltest/refcache/refcache.go:27 +0xa8
github.com/wjdp/htmltest/htmltest.Test(0x14000113aa0)
	/home/runner/work/htmltest/htmltest/htmltest/htmltest.go:93 +0x4fc
main.run(0x14000113aa0)
	/home/runner/work/htmltest/htmltest/main.go:163 +0x188
main.main()
	/home/runner/work/htmltest/htmltest/main.go:71 +0x2c0

The issue seems to be related to the LastSeen timestamp, because it works if I change the fractional seconds, e.g. removing the 9 at the end.

To Reproduce

  • Create a refcache.json with the entry mentioned above
  • Run htmltest

.htmltest.yml

Please copy in your config file

CacheExpires: 9000h

Versions

  • OS: MacOS & GitHub Runners (Ubuntu 20.04)
  • htmltest: 0.17.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant