<commit_before>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.timerstatus.qualified_integration_test_name) %>;

public class <%= repository.timerstatus.integration_test_name %>
  extends <%= repository.ee.qualified_base_integration_test_name %>
{
  @org.testng.annotations.Test
  public void checkTimersExposed()
    throws Exception
  {
<%
  timers = repository.timerstatus.timers
  timers.each do |timer|
  -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers/<%= timer %>", javax.json.JsonObject.class ).getString( "info", "" ), "<%= timer %>" );
<% end -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers", javax.json.JsonArray.class ).size(), <%= timers.size %> );
  }
}<commit_msg>Update test so it is tolerant of the timers firing during the test<commit_after>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.timerstatus.qualified_integration_test_name) %>;

public class <%= repository.timerstatus.integration_test_name %>
  extends <%= repository.ee.qualified_base_integration_test_name %>
{
  @org.testng.annotations.Test
  public void checkTimersExposed()
    throws Exception
  {
<%
  timers = repository.timerstatus.timers
  timers.each do |timer|
  -%>
    org.testng.Assert.assertEquals( httpGet( "/api/timers/<%= timer %>", javax.json.JsonObject.class ).getString( "info", "" ), "<%= timer %>" );
<% end -%>
    final javax.json.JsonArray values = httpGet( "/api/timers?fields=info", javax.json.JsonArray.class );
    final java.util.List<java.lang.String> workers = new java.util.ArrayList<>();
<% timers.each do |timer| -%>
    workers.add( "<%= timer %>.Worker" );
<% end -%>
    final java.util.List<java.lang.String> expectedValues = new java.util.ArrayList<>();
<% timers.each do |timer| -%>
    expectedValues.add( "<%= timer %>" );
<% end -%>
    final java.util.ArrayList<java.lang.String> unexpectedValues = new java.util.ArrayList<>();
    for ( final javax.json.JsonValue value : values )
    {
      final java.lang.String info = ( (javax.json.JsonObject) value ).getString( "info", "" );
      if ( expectedValues.contains( info ) )
      {
        expectedValues.remove( info );
      }
      // Workers appear briefly as part of infrastructure for managing timers but will go away, soon after
      else if ( !workers.contains( info ) )
      {
        unexpectedValues.add( info );
      }
    }
    org.testng.Assert.assertTrue( expectedValues.isEmpty(), "Failed to find expected timers " + expectedValues + ". Unexpected timers: " + unexpectedValues );
    org.testng.Assert.assertTrue( unexpectedValues.isEmpty(), "Found unexpected timers: " + unexpectedValues );
  }
}
{'fraction_non_alphanumeric': 0.15335820895522387, 'fraction_numerical': 0.0, 'mean_word_length': 3.839350180505415, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7389181', 'n_tokens_mistral': 844, 'n_tokens_neox': 801, 'n_words': 176}