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

Sometimes Panic happens during tests for TestRealtimeChannel_RTL6c2_PublishEnqueue #540

Open
Rosalita opened this issue Jun 1, 2022 · 0 comments
Labels
failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug.

Comments

@Rosalita
Copy link
Contributor

Rosalita commented Jun 1, 2022

The test TestRealtimeChannel_RTL6c2_PublishEnqueue contains a number of sub-tests which test for different connection and channel states. Sometimes this test fails with the message panic: Ack called but queue is empty. however the failure does not always occur for the same sub-test.

For example in this run the panic happened while the 9th sub-test was running for integration-test (1.17, json) https://github.com/ably/ably-go/runs/6514937687?check_suite_focus=true

ci log

=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_INITIALIZED,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_CONNECTING,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_CONNECTING,_channel_is_ATTACHING
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_ATTACHING
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_ATTACHED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_DETACHING
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_DETACHED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_CONNECTING,_channel_is_ATTACHED
panic: Ack called but queue is empty.

goroutine 2516 [running]:
github.com/ably/ably-go/ably.(*pendingEmitter).Ack(0xc00019a598, 0xc00020ad20, 0x0)
	/home/runner/work/ably-go/ably-go/ably/state.go:154 +0x7d9
github.com/ably/ably-go/ably.(*Connection).eventloop(0xc00019a500)
	/home/runner/work/ably-go/ably-go/ably/realtime_conn.go:724 +0x928
created by github.com/ably/ably-go/ably.(*Connection).connectWith

Link to test observability server for this run:
https://test-observability.herokuapp.com/repos/ably/ably-go/uploads/8edbf9c8-93f6-4610-9bb4-fea75d5c484e

On another occasion, the panic happened while the 7th sub-test was running. This was the test run for integration-test (1.18, msgpack https://github.com/ably/ably-go/runs/6692532981?check_suite_focus=true

ci log

=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_INITIALIZED,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_CONNECTING,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_CONNECTING,_channel_is_ATTACHING
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_INITIALIZED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_ATTACHING
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_ATTACHED
=== RUN   TestRealtimeChannel_RTL6c2_PublishEnqueue/when_connection_is_DISCONNECTED,_channel_is_DETACHING
panic: Ack called but queue is empty.

goroutine 2384 [running]:
github.com/ably/ably-go/ably.(*pendingEmitter).Ack(0xc00084ee58, 0xc00021f260, 0x0)
	/home/runner/work/ably-go/ably-go/ably/state.go:154 +0x811
github.com/ably/ably-go/ably.(*Connection).eventloop(0xc00084edc0)
	/home/runner/work/ably-go/ably-go/ably/realtime_conn.go:724 +0x916
created by github.com/ably/ably-go/ably.(*Connection).connectWith
	/home/runner/work/ably-go/ably-go/ably/realtime_conn.go:384 +0x61a

This issue has been seen for both Go version 1.17 and 1.18 and both json and msgpack protocols. It has also been seen on a CI run for a branch which only contained a whitespace change.

Investigation is needed to get to the bottom of this panic.

┆Issue is synchronized with this Jira Task by Unito

@Rosalita Rosalita added the failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug. label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug.
Development

No branches or pull requests

1 participant