Files
Maciej Borzecki 4484bbe60b desktop/notification/notificationtest: fix data races
Fix data races identified by go test -race caused by manipulation of fields of
an exported dbus object.

```
==================
WARNING: DATA RACE
Read at 0x00c0003f0fd0 by goroutine 191:
  github.com/godbus/dbus.(*Conn).sendError()
      /home/maciek/work/canonical/snapd/vendor/github.com/godbus/dbus/conn.go:482 +0x6cf
  github.com/godbus/dbus.(*Conn).handleCall()
      /home/maciek/work/canonical/snapd/vendor/github.com/godbus/dbus/export.go:155 +0x9dc
  github.com/godbus/dbus.(*Conn).inWorker.gowrap1()
      /home/maciek/work/canonical/snapd/vendor/github.com/godbus/dbus/conn.go:334 +0x44

Previous write at 0x00c0003f0fd0 by goroutine 182:
  github.com/snapcore/snapd/desktop/notification_test.(*gtkSuite).TestCloseNotificationError()
      /home/maciek/work/canonical/snapd/desktop/notification/gtk_test.go:108 +0x224
  runtime.call16()
      /usr/lib/go/src/runtime/asm_amd64.s:770 +0x42
  reflect.Value.Call()
      /usr/lib/go/src/reflect/value.go:380 +0xb5
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:775 +0x9c5
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:669 +0xe9

Goroutine 191 (running) created at:
  github.com/godbus/dbus.(*Conn).inWorker()
      /home/maciek/work/canonical/snapd/vendor/github.com/godbus/dbus/conn.go:334 +0x346
  github.com/godbus/dbus.(*Conn).Auth.gowrap1()
      /home/maciek/work/canonical/snapd/vendor/github.com/godbus/dbus/auth.go:118 +0x33

Goroutine 182 (running) created at:
  gopkg.in/check%2ev1.(*suiteRunner).forkCall()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:666 +0x5ba
  gopkg.in/check%2ev1.(*suiteRunner).forkTest()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:757 +0x155
  gopkg.in/check%2ev1.(*suiteRunner).runTest()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:812 +0x419
  gopkg.in/check%2ev1.(*suiteRunner).run()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/check.go:618 +0x3c6
  gopkg.in/check%2ev1.Run()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/run.go:92 +0x44
  gopkg.in/check%2ev1.RunAll()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/run.go:84 +0x124
  gopkg.in/check%2ev1.TestingT()
      /home/maciek/work/canonical/snapd/vendor/gopkg.in/check.v1/run.go:72 +0x5d3
  github.com/snapcore/snapd/desktop/notification_test.Test()
      /home/maciek/work/canonical/snapd/desktop/notification/notify_test.go:30 +0x26
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/lib/go/src/testing/testing.go:1742 +0x44
==================
```

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-04-16 12:00:37 +02:00
..