perhapzz
0276554d9c
test(fileutil,health): add unit tests for WriteFileAtomic and health server
Add comprehensive test coverage for two previously untested packages:
pkg/fileutil (9 tests):
- Basic write and read-back
- File permissions (0600)
- Overwrite existing files
- Empty data handling
- Nested directory auto-creation
- No temp files left after success
- Large file (1MB) handling
- Concurrent write safety
- Invalid path error handling
pkg/health (15 tests):
- Health endpoint returns 200 with status, uptime, pid
- Ready endpoint returns 503 when not ready
- Ready endpoint returns 200 when ready
- Ready fails when any registered check fails
- Ready passes with all checks passing
- Reload rejects non-POST methods
- Reload returns 503 when no reload func set
- Reload calls registered function on success
- Reload returns 500 on function error
- SetReady toggle behavior
- Multiple health checks interaction
- RegisterOnMux works with custom ServeMux
- NewServer defaults
- StartContext graceful shutdown on cancel
- statusString helper
2026-03-20 10:41:08 +00:00
..
2026-03-19 21:52:10 +01:00
2026-03-18 18:03:24 +08:00
2026-03-18 00:12:12 +08:00
2026-03-20 12:59:43 +08:00
2026-03-19 13:42:36 +08:00
2026-03-20 00:23:40 +08:00
2026-02-19 11:48:17 +01:00
2026-03-18 18:03:24 +08:00
2026-03-18 00:02:51 +08:00
2026-02-24 21:52:25 +08:00
2026-03-20 10:41:08 +00:00
2026-03-19 15:28:52 +08:00
2026-03-20 10:41:08 +00:00
2026-03-01 18:17:32 +11:00
2026-03-13 15:41:18 +08:00
2026-03-18 14:43:58 +08:00
2026-03-05 14:53:26 +08:00
2026-03-14 12:01:47 +08:00
2026-03-11 14:29:42 +08:00
2026-03-18 21:29:21 +08:00
2026-03-19 22:07:30 +08:00
2026-03-06 13:10:20 +08:00
2026-03-11 19:22:20 +08:00
2026-03-13 14:04:02 +08:00
2026-03-11 19:22:20 +08:00
2026-03-19 17:01:45 +08:00
2026-03-17 16:37:22 +01:00
2026-03-04 10:21:59 +00:00