replace panic by log.Fatal in tests

Related to #2137