Skip to content

[Bug]: Data race in TestService_Cleanup #637

Description

@CubicrootXYZ

Describe the bug


WARNING: DATA RACE
Write at 0x00c00042c168 by goroutine 17:
  runtime.racewrite()
      <autogenerated>:1 +0x1e
  github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon_test.TestService_Cleanup.gowrap1()
      /__w/RemindMe/RemindMe/internal/daemon/cleanup_test.go:19 +0x39

Previous read at 0x00c00042c168 by goroutine 18:
  runtime.raceread()
      <autogenerated>:1 +0x1e
  github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon.(*service).Start.gowrap1()
      /__w/RemindMe/RemindMe/internal/daemon/service.go:97 +0x2e

Goroutine 17 (running) created at:
  github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon_test.TestService_Cleanup()
      /__w/RemindMe/RemindMe/internal/daemon/cleanup_test.go:19 +0x44f
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:2036 +0x21c
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:2101 +0x38

Goroutine 18 (finished) created at:
  github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon.(*service).Start()
      /__w/RemindMe/RemindMe/internal/daemon/service.go:97 +0xde
  github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon_test.TestService_Cleanup.gowrap1()
      /__w/RemindMe/RemindMe/internal/daemon/cleanup_test.go:19 +0x39
==================
--- FAIL: TestService_Cleanup (0.01s)
    testing.go:1712: race detected during execution of test
2026/06/24 17:21:20 ERROR failed to send out events error=test
2026/06/24 17:21:20 ERROR failed to send out events error=test
2026/06/24 17:21:20 ERROR failed to send out events error=test
2026/06/24 17:21:20 ERROR failed to send out events error=test
2026/06/24 17:21:20 ERROR failed to send out events error=test
2026/06/24 17:21:20 ERROR failed to send reminder to output error=test output.id=1 output.type=test
2026/06/24 17:21:20 ERROR failed to send reminder to output error=test output.id=1 output.type=test
2026/06/24 17:21:20 ERROR failed to send reminder to output error=test output.id=1 output.type=test
FAIL
2026/06/24 17:21:20 ERROR failed to send reminder to output error=test output.id=1 output.type=test
coverage: 67.3% of statements
FAIL	github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/daemon	0.052s
ok  	github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/database	1.719s	coverage: 22.0% of statements
	github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/database/tests		coverage: 0.0% of statements
	github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/metricserver		coverage: 0.0% of statements
ok  	github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/internal/random	1.850s	coverage: 87.5% of statements
FAIL

Reproduce the bug

No response

How sever is this bug?

MID (default)

Version

latest

Checklist

  • I was able to reproduce the bug with the newest version of the bot
  • I confirmed that there is no other issue reporting the same bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions