Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Sometimes travis test will fail on Android 4.4 because setInterval #604

@JiaLiPassion

Description

@JiaLiPassion

I always run into travis build fail(for example, this build because one specified case in setInterval.spec.ts
can be simplified as the following case.

  intervalCount = 0;
  id = setInterval(() => {
    intervalCount ++;
    setTimeout(() => {
       expect(intervalCount).toBe(1);
      clearInterval(id);
    });
  }, 10);

In most cases, the interval will only run once, but in Android 4.4, for some reasons, the interval will run twice, I check the setTimeout/setInterval document online, that setInterval may execute at once if the setInterval callback run long enough, so it may have a chance to run 2nd time before setTimeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions